From 6b1af5cbabef28541748bfc88c8ff1e7b9751d65 Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sat, 31 May 2025 12:25:28 -0700 Subject: [PATCH 1/4] flake: pkgsForEach: replace legacyPackages with manual import --- flake.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index affc70b..135a05a 100644 --- a/flake.nix +++ b/flake.nix @@ -7,7 +7,10 @@ ... } @ inputs: let forAllSystems = nixpkgs.lib.genAttrs ["x86_64-linux" "aarch64-linux"]; - pkgsForEach = nixpkgs.legacyPackages; + pkgsForEach = forAllSystems (system: + import nixpkgs { + localSystem.system = system; + }); in { packages = forAllSystems (system: { superfreq = pkgsForEach.${system}.callPackage ./nix/package.nix {}; From 08c51b6296d868c77724b4ccec091e75f42a999a Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sat, 31 May 2025 12:27:32 -0700 Subject: [PATCH 2/4] flake: overlays: add superfreq and default --- flake.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/flake.nix b/flake.nix index 135a05a..8318810 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,13 @@ localSystem.system = system; }); in { + overlays = { + superfreq = final: _: { + superfreq = final.callPackage ./nix/package.nix {}; + }; + default = self.overlays.superfreq; + }; + packages = forAllSystems (system: { superfreq = pkgsForEach.${system}.callPackage ./nix/package.nix {}; default = self.packages.${system}.superfreq; From 3caaa22f3efeba6e3cf3a2a204aa015fb4264394 Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sat, 31 May 2025 12:43:55 -0700 Subject: [PATCH 3/4] flake: packages: inherit from default overlay --- flake.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 8318810..4c012bb 100644 --- a/flake.nix +++ b/flake.nix @@ -10,6 +10,7 @@ pkgsForEach = forAllSystems (system: import nixpkgs { localSystem.system = system; + overlays = [self.overlays.default]; }); in { overlays = { @@ -19,10 +20,12 @@ default = self.overlays.superfreq; }; - packages = forAllSystems (system: { - superfreq = pkgsForEach.${system}.callPackage ./nix/package.nix {}; - default = self.packages.${system}.superfreq; - }); + packages = + nixpkgs.lib.mapAttrs (system: pkgs: { + inherit (pkgs) superfreq; + default = self.packages.${system}.superfreq; + }) + pkgsForEach; devShells = forAllSystems (system: { default = pkgsForEach.${system}.callPackage ./nix/shell.nix {}; From 0f3d5d81dd96a25642ca7239a17843d5e9639217 Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sat, 31 May 2025 13:11:25 -0700 Subject: [PATCH 4/4] flake: devShells: use same pkgs as for packages output --- flake.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 4c012bb..96f329d 100644 --- a/flake.nix +++ b/flake.nix @@ -27,9 +27,11 @@ }) pkgsForEach; - devShells = forAllSystems (system: { - default = pkgsForEach.${system}.callPackage ./nix/shell.nix {}; - }); + devShells = + nixpkgs.lib.mapAttrs (system: pkgs: { + default = pkgs.callPackage ./nix/shell.nix {}; + }) + pkgsForEach; nixosModules = { superfreq = import ./nix/module.nix inputs;