machines-config/lib.nix

43 lines
848 B
Nix
Raw Normal View History

2024-12-18 11:34:20 +01:00
{
inputs,
}:
{
2024-12-19 00:02:50 +01:00
mkHost =
2024-12-20 00:06:32 +01:00
{
name,
arch ? "x86_64-linux",
2025-01-10 23:11:21 +01:00
config_name ? name,
2024-12-20 00:06:32 +01:00
}:
inputs.nixpkgs.lib.nixosSystem {
2024-12-18 11:34:20 +01:00
system = arch;
modules = [
2024-12-20 10:03:05 +01:00
./hosts/base
2025-01-10 23:11:21 +01:00
./hosts/${config_name}
2024-12-18 11:34:20 +01:00
./nixosModules
2024-12-19 00:02:50 +01:00
(
{ ... }:
{
config = {
networking.hostName = name;
};
}
)
2024-12-20 10:03:05 +01:00
inputs.disko.nixosModules.disko
2024-12-31 15:36:50 +01:00
inputs.agenix.nixosModules.default
2024-12-18 11:34:20 +01:00
];
specialArgs = {
inherit inputs;
};
};
2025-01-10 23:11:21 +01:00
# TODO: this will actually be nice, so I can see IPs in main flake.nix,
# but also dont have three directories with only default.nix in it
# mkK3Snode = {
# name_prefix,
# id,
# ip
# }: mkHost {
# name = "${name_prefix}-${id}";
# config_name = "k3snode";
# };
2024-12-18 11:34:20 +01:00
}