build-clan: force system override in secrets generators

This commit is contained in:
Jörg Thalheim
2024-01-17 15:38:41 +01:00
committed by Mic92
parent 4f13eab871
commit a183553419

View File

@@ -30,7 +30,7 @@ let
(machineSettings.clanImports or [ ]); (machineSettings.clanImports or [ ]);
# TODO: remove default system once we have a hardware-config mechanism # TODO: remove default system once we have a hardware-config mechanism
nixosConfiguration = { system ? "x86_64-linux", name }: nixpkgs.lib.nixosSystem { nixosConfiguration = { system ? "x86_64-linux", name, forceSystem ? false }: nixpkgs.lib.nixosSystem {
modules = modules =
let let
settings = machineSettings name; settings = machineSettings name;
@@ -45,7 +45,7 @@ let
clanCore.clanName = clanName; clanCore.clanName = clanName;
clanCore.clanIcon = clanIcon; clanCore.clanIcon = clanIcon;
clanCore.clanDir = directory; clanCore.clanDir = directory;
nixpkgs.hostPlatform = lib.mkDefault system; nixpkgs.hostPlatform = if forceSystem then lib.mkForce system else lib.mkDefault system;
# speeds up nix commands by using the nixpkgs from the host system (especially useful in VMs) # speeds up nix commands by using the nixpkgs from the host system (especially useful in VMs)
nix.registry.nixpkgs.to = { nix.registry.nixpkgs.to = {
@@ -75,7 +75,7 @@ let
configsPerSystem = builtins.listToAttrs configsPerSystem = builtins.listToAttrs
(builtins.map (builtins.map
(system: lib.nameValuePair system (system: lib.nameValuePair system
(lib.mapAttrs (name: _: nixosConfiguration { inherit name system; }) allMachines)) (lib.mapAttrs (name: _: nixosConfiguration { inherit name system; forceSystem = true; }) allMachines))
supportedSystems); supportedSystems);
in in
{ {