From 382e27a20b9a22faa200941a27a794e1d73fcadf Mon Sep 17 00:00:00 2001 From: Qubasa Date: Fri, 8 Nov 2024 14:11:26 +0700 Subject: [PATCH] clan: Remove pkgsForSystem --- lib/build-clan/interface.nix | 14 ++------------ lib/build-clan/module.nix | 11 +++++++---- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/lib/build-clan/interface.nix b/lib/build-clan/interface.nix index 8dd3abf74..df4743980 100644 --- a/lib/build-clan/interface.nix +++ b/lib/build-clan/interface.nix @@ -3,6 +3,7 @@ let types = lib.types; in { + options = { # Required options directory = lib.mkOption { @@ -69,18 +70,6 @@ in 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 nixosConfigurations = lib.mkOption { # Hide from documentation. @@ -112,4 +101,5 @@ in }; }; }; + } diff --git a/lib/build-clan/module.nix b/lib/build-clan/module.nix index 079a7762c..cf2a34e54 100644 --- a/lib/build-clan/module.nix +++ b/lib/build-clan/module.nix @@ -9,7 +9,6 @@ let inherit (config) directory machines - pkgsForSystem specialArgs ; @@ -58,7 +57,7 @@ let # Settings clan.core.clanDir = directory; # Inherited from clan wide settings - # TODO: remove these + # TODO: remove these` clan.core.name = config.inventory.meta.name; clan.core.icon = config.inventory.meta.icon; @@ -105,7 +104,11 @@ let name: _: nixosConfiguration { inherit name system; - pkgs = pkgsForSystem system; + + # We removed pkgsForSystems because we have the problem that nixpkgs.* options are then ignored + # However our current model is to have the hardware config read and then set nixpkgs.hostPlatform automatically + # which gets ignored if we set pkgsForSystems + pkgs = nixpkgs.legacyPackages.${system}; } ) allMachines ) @@ -122,7 +125,7 @@ let args // { inherit name system; - pkgs = pkgsForSystem system; + pkgs = nixpkgs.legacyPackages.${system}; } ) ) allMachines