diff --git a/flake.nix b/flake.nix index bb17a090..26c097d9 100644 --- a/flake.nix +++ b/flake.nix @@ -358,7 +358,10 @@ ]; config = lib.mkMerge [ - { networking.hostName = lib.mkForce metadata.hostname or host; } + { + networking.hostName = lib.mkForce metadata.hostname or host; + nixpkgs.hostPlatform = metadata._system; + } (lib.mkIf (metadata ? domain) { networking.domain = lib.mkForce metadata.domain; }) @@ -377,7 +380,6 @@ (host: metadata: mkHost { extraModules = [ (hostSpecificModule host metadata) ]; - system = metadata._system; nixpkgs-channel = metadata.nixpkgs-channel or "nixpkgs"; }) (listImagesWithSystems images); @@ -453,7 +455,7 @@ format = metadata.format or "iso"; in lib'.nameValuePair name (mkImage { - inherit format system pkgs; + inherit format pkgs; extraModules = [ (hostSpecificModule host metadata) ]; })) images'); diff --git a/lib/images.nix b/lib/images.nix index 8dba7e7f..ee350135 100644 --- a/lib/images.nix +++ b/lib/images.nix @@ -9,11 +9,10 @@ let in { # A wrapper around the NixOS configuration function. - mkHost = { system, extraModules ? [ ], nixpkgs-channel ? "nixpkgs" }: + mkHost = { extraModules ? [ ], nixpkgs-channel ? "nixpkgs" }: let lib' = inputs.${nixpkgs-channel}.lib.extend extendLib; in (lib'.makeOverridable lib'.nixosSystem) { - # The system of the NixOS system. - modules = extraModules ++ [{ nixpkgs.hostPlatform = system; }]; + modules = extraModules; }; # A wrapper around the home-manager configuration function. @@ -25,9 +24,9 @@ in }; # A wrapper around the nixos-generators `nixosGenerate` function. - mkImage = { system, pkgs ? null, extraModules ? [ ], format ? "iso" }: + mkImage = { pkgs ? null, extraModules ? [ ], format ? "iso" }: inputs.nixos-generators.nixosGenerate { - inherit pkgs system format; + inherit pkgs format; lib = pkgs.lib.extend extendLib; modules = extraModules; };