mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 08:28:11 +09:00
feat: add hosts and overlays module structure
This commit is contained in:
@@ -11,5 +11,7 @@
|
||||
!/flake.lock
|
||||
|
||||
!shells/
|
||||
!hosts/
|
||||
!overlays/
|
||||
|
||||
!/flake/
|
||||
|
||||
@@ -95,9 +95,11 @@
|
||||
systems = import systems;
|
||||
|
||||
imports = [
|
||||
./overlays
|
||||
./hosts
|
||||
./shells
|
||||
./flake/formatter.nix
|
||||
./flake/git-hooks.nix
|
||||
./shells
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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 = [ ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
_: { }
|
||||
Reference in New Issue
Block a user