chore: use nim2nix on nix

This commit is contained in:
Daylin Morgan 2024-09-05 13:17:50 -05:00
parent 7fb9a2d6b4
commit 15e5cf6933
Signed by: daylin
GPG key ID: 950D13E9719334AD
3 changed files with 78 additions and 76 deletions

View file

@ -1,12 +1,46 @@
{
"nodes": {
"nim2nix": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1725469705,
"narHash": "sha256-4/iSUwB3XKmybdt4R87VhBPiD3z4BL6RrD9LyrrkesM=",
"owner": "daylinmorgan",
"repo": "nim2nix",
"rev": "42af12ca45025c7146bc24e27f5d8b65b003d663",
"type": "github"
},
"original": {
"owner": "daylinmorgan",
"repo": "nim2nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1710765496,
"narHash": "sha256-p7ryWEeQfMwTB6E0wIUd5V2cFTgq+DRRBz2hYGnJZyA=",
"lastModified": 1724479785,
"narHash": "sha256-pP3Azj5d6M5nmG68Fu4JqZmdGt4S4vqI5f8te+E/FTw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "e367f7a1fb93137af22a3908f00b9a35e2d286a7",
"rev": "d0e1602ddde669d5beb01aec49d71a51937ed7be",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1725369773,
"narHash": "sha256-gT+rUDbw+TQuszQEzMUJWTW7QYtccZ5xxWmKOSrPvEw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8b4061fd60ccc3b3f44b73faa7c983eacf7a6f7b",
"type": "github"
},
"original": {
@ -18,7 +52,8 @@
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
"nim2nix": "nim2nix",
"nixpkgs": "nixpkgs_2"
}
}
},

View file

@ -2,31 +2,50 @@
description = "tsm";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nim2nix.url = "github:daylinmorgan/nim2nix";
};
outputs = {
self,
nixpkgs,
}: let
inherit (nixpkgs.lib) genAttrs;
supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
forAllSystems = f: genAttrs supportedSystems (system: f nixpkgs.legacyPackages.${system});
in {
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [ nim nimble ];
};
});
packages = forAllSystems (
pkgs: {
tsm = pkgs.buildNimPackage {
outputs =
{
self,
nixpkgs,
nim2nix,
}:
let
inherit (nixpkgs.lib) genAttrs;
supportedSystems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
forAllSystems =
f:
genAttrs supportedSystems (
system:
f (import nixpkgs {
inherit system;
overlays = [nim2nix.overlays.default];
}
));
in
{
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
nim
nimble
];
};
});
packages = forAllSystems (pkgs: {
tsm = pkgs.buildNimblePackage {
pname = "tsm";
version = "2024.1001";
src = ../.;
lockFile = ./lock.json;
nimbleDepsHash = "sha256-1J0Wt/XjFiSN1MTfgg9tE5dY3GnXH/UgG3zCL19GgpU=";
};
default = self.packages.${pkgs.system}.tsm;
}
);
};
});
};
}

View file

@ -1,52 +0,0 @@
{
"depends": [
{
"method": "fetchzip",
"path": "/nix/store/k3sxzm7qnkgnwkrfd8hc3gkwzbayb1h1-source",
"rev": "99a120f7f69868b94f5d35ce7e21dd12535de70c",
"sha256": "0hiic5yjsaw6sgl1jzmfpm5g6a5ckzmd29c3pzg30glchn2g94sk",
"srcDir": "",
"url": "https://github.com/johnnovak/illwill/archive/99a120f7f69868b94f5d35ce7e21dd12535de70c.tar.gz",
"subDir": "",
"packages": [
"illwill"
]
},
{
"method": "fetchzip",
"path": "/nix/store/pgajs406yg0ffw099np6fca3psf8zlvr-source",
"rev": "25574d165bb7f60900b36590bc49f3d90e47cea4",
"sha256": "0qf162bagcgnxjsjpg560cz6kdshhsyrkzq3j471a8pxrhwp608i",
"srcDir": "src",
"url": "https://github.com/usu-dev/usu-nim/archive/25574d165bb7f60900b36590bc49f3d90e47cea4.tar.gz",
"subDir": "",
"packages": [
"usu"
]
},
{
"method": "fetchzip",
"path": "/nix/store/4h59kkd5db97j5m92szryjydxyr9bnwg-source",
"rev": "4193f802796f15559c81c6dd56724d6f20345917",
"sha256": "04w4hy5zbcmp173jx72b89jk9l7rnpqv9d3cgs8lwmfcagjac7zz",
"srcDir": "",
"url": "https://github.com/c-blake/cligen/archive/4193f802796f15559c81c6dd56724d6f20345917.tar.gz",
"subDir": "",
"packages": [
"cligen"
]
},
{
"method": "fetchzip",
"path": "/nix/store/ws9bc49njd13lzlankiw9vz85h56n0sn-source",
"rev": "9a85d9ed028f06f1ed1ee6851480a51408a6004e",
"sha256": "04r9wincqd4a5hmxixbsw0zjpvlrpckny4jkzahvbnh8s5f1xlc6",
"srcDir": "src",
"url": "https://github.com/daylinmorgan/bbansi/archive/9a85d9ed028f06f1ed1ee6851480a51408a6004e.tar.gz",
"subDir": "",
"packages": [
"bbansi"
]
}
]
}