Revert "clan: Remove pkgsForSystem"

This reverts commit 382e27a20b.
This commit is contained in:
Qubasa
2024-11-11 21:50:25 +07:00
parent 2cc8473bc4
commit 130aeb36b7
2 changed files with 15 additions and 4 deletions

View File

@@ -3,7 +3,6 @@ let
types = lib.types; types = lib.types;
in in
{ {
options = { options = {
# Required options # Required options
directory = lib.mkOption { directory = lib.mkOption {
@@ -70,6 +69,18 @@ in
default = { }; default = { };
}; };
pkgsForSystem = lib.mkOption {
type = types.functionTo (types.nullOr types.attrs);
default = _: null;
defaultText = "Lambda :: String -> { ... } | null";
description = ''
A function that maps from architecture to pkg. `( string -> pkgs )`
If specified this nixpkgs will be only imported once for each system.
This improves performance, but all nipxkgs.* options will be ignored.
'';
};
# Outputs # Outputs
nixosConfigurations = lib.mkOption { nixosConfigurations = lib.mkOption {
# Hide from documentation. # Hide from documentation.
@@ -101,5 +112,4 @@ in
}; };
}; };
}; };
} }

View File

@@ -9,6 +9,7 @@ let
inherit (config) inherit (config)
directory directory
machines machines
pkgsForSystem
specialArgs specialArgs
; ;
@@ -57,7 +58,7 @@ let
# Settings # Settings
clan.core.clanDir = directory; clan.core.clanDir = directory;
# Inherited from clan wide settings # Inherited from clan wide settings
# TODO: remove these` # TODO: remove these
clan.core.name = config.inventory.meta.name; clan.core.name = config.inventory.meta.name;
clan.core.icon = config.inventory.meta.icon; clan.core.icon = config.inventory.meta.icon;
@@ -126,7 +127,7 @@ let
args args
// { // {
inherit name system; inherit name system;
pkgs = nixpkgs.legacyPackages.${system}; pkgs = pkgsForSystem system;
} }
) )
) allMachines ) allMachines