Provide pkgs in forAllSystems

This is stolen from DavHau's dream2nix flake which reworks forAllSystems to provide two arguments, the pkgs and the system.
This commit is contained in:
matthewcroughan 2022-03-31 17:40:00 +01:00
parent f042b0170e
commit fcae9a11d0

View file

@ -7,8 +7,11 @@
let let
version = builtins.substring 0 8 self.lastModifiedDate; version = builtins.substring 0 8 self.lastModifiedDate;
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems; forSystems = systems: f:
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; overlays = [ self.overlay ]; }); nixpkgs.lib.genAttrs systems
(system: f system nixpkgs.legacyPackages.${system});
forAllSystems = forSystems supportedSystems;
nixpkgsFor = forAllSystems (system: pkgs: import nixpkgs { inherit system; overlays = [ self.overlay ]; });
in rec in rec
{ {
overlay = final: prev: { overlay = final: prev: {
@ -69,6 +72,6 @@
); );
}; };
}; };
nixinate = forAllSystems (system: nixpkgsFor.${system}.generateApps); nixinate = forAllSystems (system: pkgs: nixpkgsFor.${system}.generateApps);
}; };
} }