diff options
2 files changed, 12 insertions, 5 deletions
| -rw-r--r-- | autoconfig.nix | 16 | ||||
| -rw-r--r-- | flake.nix | 1 |
diff --git a/autoconfig.nix b/autoconfig.nix index f830bcb..2872be6 100644 --- a/autoconfig.nix +++ b/autoconfig.nix @@ -2,6 +2,12 @@ let inherit (inputs) nixpkgs; inherit (nixpkgs) lib; + + custom-packages = system: + lib.mapAttrs + (name: _: + nixpkgs.legacyPackages.${system}.callPackage ./packages/${name} { }) + (lib.filterAttrs (_: type: type == "directory") (builtins.readDir ./packages)); in { configurations = lib.mapAttrs @@ -49,11 +55,7 @@ in { lib.hasPrefix "nixpkgs-" name) inputs); - custom-packages-overlays = - lib.mapAttrs - (name: _: - nixpkgs.legacyPackages.${sysidentity.arch}.callPackage ./packages/${name} { }) - (lib.filterAttrs (_: type: type == "directory") (builtins.readDir ./packages)); + custom-packages-overlays = custom-packages sysidentity.arch; package-overlays = lib.mapAttrsToList @@ -78,4 +80,8 @@ in { ++ package-modules; }) (lib.filterAttrs (_: type: type == "directory") (builtins.readDir ./machines)); + packages = let + systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ]; + in + lib.genAttrs systems (system: custom-packages system); } @@ -13,5 +13,6 @@ autoconfig = import ./autoconfig.nix { inherit inputs; }; in { nixosConfigurations = autoconfig.configurations; + inherit (autoconfig) packages; }; } |
