mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 06:19:00 +00:00
config: set system on default host config
This commit is contained in:
parent
1f74f96fc4
commit
10c3509121
@ -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');
|
||||
|
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user