From 25b6197c4af1ab8247a4b39267dfd215e4b57ae1 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 5 Jul 2025 18:11:21 +0300 Subject: feat(autoconfig): Expose custom packages in flake --- autoconfig.nix | 16 +++++++++++----- flake.nix | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) 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); } diff --git a/flake.nix b/flake.nix index b695c5d..0c78b03 100644 --- a/flake.nix +++ b/flake.nix @@ -13,5 +13,6 @@ autoconfig = import ./autoconfig.nix { inherit inputs; }; in { nixosConfigurations = autoconfig.configurations; + inherit (autoconfig) packages; }; } -- cgit v1.3.1-26-gb76a