add lib.forAllSystems

This commit is contained in:
Sean Buckley 2021-06-25 01:04:30 -04:00
parent 06ed57e5ad
commit 8ea4a79f72
2 changed files with 21 additions and 13 deletions

View file

@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1624172050,
"narHash": "sha256-sLQEhZ6Ffjx0J1AJxHQDY4y7XWKxI/Zgm/hQJjkjZ6M=",
"lastModified": 1624522661,
"narHash": "sha256-BjkxYyGQYck5muCpPMfCtEQv/wRmD4kVEE7tiAQOS+Y=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6613a30c5e3ee59753181512b4bedd4121569925",
"rev": "0b8b127125e5271f5c8636680b6fe274844aaa9d",
"type": "github"
},
"original": {
@ -23,11 +23,11 @@
},
"unstable": {
"locked": {
"lastModified": 1624024598,
"narHash": "sha256-X++38oH5MKEmPW4/2WdMaHQvwJzO8pJfbnzMD7DbG1E=",
"lastModified": 1624447853,
"narHash": "sha256-Zn+vTEa3NE9q6z6ytpcNXrr8jV7HvrKRxMYoD2E6DpE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "33d42ad7cf2769ce6364ed4e52afa8e9d1439d58",
"rev": "1905f5f2e55e0db0bb6244cfe62cb6c0dbda391d",
"type": "github"
},
"original": {

View file

@ -22,20 +22,27 @@
nixosConfigurations = self.lib.getHosts inputs ./hosts;
lib.getHosts = import lib/hosts.nix;
lib = {
getHosts = import lib/hosts.nix;
forAllSystems = f: builtins.listToAttrs (map
(name: { inherit name; value = f name; })
(nixpkgs.lib.platforms.all)
);
};
packages."x86_64-linux" =
with nixpkgs.legacyPackages."x86_64-linux";
packages = self.lib.forAllSystems (system:
with nixpkgs.legacyPackages.${system};
{
binaryninja = callPackage ./pkgs/binary-ninja-personal { };
commander-x16 = callPackage ./pkgs/commander-x16 { };
gef = callPackage ./pkgs/gef { };
packettracer = callPackage ./pkgs/packettracer { };
weevely = callPackage ./pkgs/weevely { };
};
}
);
apps."x86_64-linux" =
with nixpkgs.legacyPackages."x86_64-linux";
apps = self.lib.forAllSystems (system:
with nixpkgs.legacyPackages.${system};
{
format-luks = writeShellScriptBin "format-luks" ''
set -e
@ -52,6 +59,7 @@
mkdir /mnt/home
mount /dev/mapper/cryptroot /mnt/home -o discard,compress=zstd,subvol=/home
'';
};
}
);
};
}