switched to flakes and built out modularity

This commit is contained in:
2026-02-11 13:45:21 -05:00
parent 5f6a53c15f
commit c5a99c5b75
15 changed files with 489 additions and 151 deletions

21
modules/services/k3s.nix Normal file
View File

@@ -0,0 +1,21 @@
{ config, lib, ... }:
let
cfg = config.control.k3s;
in
{
config = lib.mkIf cfg.enable {
services.k3s = {
enable = true;
role = cfg.role;
clusterInit = cfg.clusterInit;
serverAddr = cfg.serverAddr;
tokenFile = cfg.tokenFile;
};
networking.firewall = lib.mkIf cfg.openFirewall {
allowedTCPPorts = [ 6443 2379 2380 ];
allowedUDPPorts = [ 8472 ];
};
};
}