feat: add hosts and overlays module structure

This commit is contained in:
2026-05-28 12:34:05 +09:00
parent e499b952b7
commit 57c4ac099e
4 changed files with 45 additions and 1 deletions
+39
View File
@@ -0,0 +1,39 @@
{
inputs,
config,
lib,
...
}:
let
inherit (inputs.nixpkgs.lib) nixosSystem;
mkSystem =
{
host,
system,
extraModules ? [ ],
...
}:
assert lib.assertMsg (lib.elem system config.systems)
"mkSystem: system '${system}' not in valid systems: ${lib.generators.toPretty { } config.systems}";
nixosSystem {
inherit system;
modules = [
{
networking.hostName = lib.mkDefault host;
}
]
++ extraModules;
specialArgs = { inherit inputs; };
};
in
{
flake.nixosConfigurations = {
nix-example = mkSystem {
host = "nix-example";
system = "x86_64-linux";
profile = "laptop";
extraModules = [ ];
};
};
}