diff options
| Commit | 25b6197c4af1ab8247a4b39267dfd215e4b57ae1 (patch) | |
|---|---|---|
| Author | 2025-07-05 18:11:21 +0300 | |
| Committer | 2025-07-05 18:11:21 +0300 | |
| Files | d5bf9fdef88a0617cc5e4484c617735d8d8b5df5 | |
| nix-25b6197c4af1ab8247a4b39267dfd215e4b57ae1.tar nix-25b6197c4af1ab8247a4b39267dfd215e4b57ae1.tar.gz nix-25b6197c4af1ab8247a4b39267dfd215e4b57ae1.zip | ||
| Parent | 9c11b375cd2aa0d4bf1c8d8d979dc850d64b9bbb (diff) | |
feat(autoconfig): Expose custom packages in flake
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; }; } |
