feat(dotfiles): migrate flake scaffolding
This commit is contained in:
45
src/dotfiles/hosts.nix
Normal file
45
src/dotfiles/hosts.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
root,
|
||||
specialArgs,
|
||||
repositoryModules,
|
||||
|
||||
guestModules,
|
||||
registryModule,
|
||||
}:
|
||||
let
|
||||
mkHost =
|
||||
{
|
||||
root,
|
||||
name,
|
||||
}:
|
||||
lib.nixosSystem {
|
||||
inherit specialArgs;
|
||||
modules = [
|
||||
inputs.chaotic.nixosModules.default
|
||||
inputs.disko.nixosModules.disko
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
inputs.stylix.nixosModules.stylix
|
||||
|
||||
repositoryModules
|
||||
guestModules
|
||||
|
||||
# TODO: refactor
|
||||
registryModule (root + "/${name}")
|
||||
|
||||
{
|
||||
networking.hostName = name;
|
||||
modules.host.enable = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
in
|
||||
let
|
||||
directories = lib.filterAttrs (_name: type: type == "directory") (builtins.readDir root);
|
||||
names = lib.attrNames directories;
|
||||
in
|
||||
lib.genAttrs names (
|
||||
name:
|
||||
mkHost { inherit root name; }
|
||||
)
|
||||
Reference in New Issue
Block a user