Files
nix-config/outputs/x86_64-linux/src/k3s-prod-1-master-1.nix
Ryan Yin b382999a70 refactor: Use haumea for filesystem-based module system for flake outputs
refactor: Use hyphen(`-`) for variable names & folder names(except Python), replace all unserscore(`_`) with hyphen(`-`).
2024-03-10 20:12:02 +08:00

45 lines
1.1 KiB
Nix

{
# NOTE: the args not used in this file CAN NOT be removed!
# because haumea pass argument lazily,
# and these arguments are used in the functions like `mylib.nixosSystem`, `mylib.colmenaSystem`, etc.
inputs,
lib,
mylib,
myvars,
system,
genSpecialArgs,
...
} @ args: let
name = "k3s-prod-1-master-1";
tags = [name];
ssh-user = "root";
modules = {
nixos-modules =
(map mylib.relativeToRoot [
# common
"secrets/nixos.nix"
"modules/nixos/server/server.nix"
"modules/nixos/server/proxmox-hardware-configuration.nix"
# host specific
"hosts/k8s/${name}"
])
++ [
{modules.secrets.server.kubernetes.enable = true;}
];
home-modules.imports = map mylib.relativeToRoot [
"home/linux/server.nix"
];
};
systemArgs = modules // args;
in {
nixosConfigurations.${name} = mylib.nixosSystem systemArgs;
colmena.${name} =
mylib.colmenaSystem (systemArgs // {inherit tags ssh-user;});
# generate proxmox image for virtual machines without desktop environment
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.proxmox;
}