From fcae9a11d062a6e67701ce3fed63fd27f04426dd Mon Sep 17 00:00:00 2001 From: matthewcroughan Date: Thu, 31 Mar 2022 17:40:00 +0100 Subject: [PATCH] Provide pkgs in forAllSystems This is stolen from DavHau's dream2nix flake which reworks forAllSystems to provide two arguments, the pkgs and the system. --- flake.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index e54f503..779c589 100644 --- a/flake.nix +++ b/flake.nix @@ -7,8 +7,11 @@ let version = builtins.substring 0 8 self.lastModifiedDate; supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; - forAllSystems = nixpkgs.lib.genAttrs supportedSystems; - nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; overlays = [ self.overlay ]; }); + forSystems = systems: f: + 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 { overlay = final: prev: { @@ -69,6 +72,6 @@ ); }; }; - nixinate = forAllSystems (system: nixpkgsFor.${system}.generateApps); + nixinate = forAllSystems (system: pkgs: nixpkgsFor.${system}.generateApps); }; }