switched to flakes and built out modularity
This commit is contained in:
21
modules/services/k3s.nix
Normal file
21
modules/services/k3s.nix
Normal 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 ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user