switched to flakes and built out modularity
This commit is contained in:
119
modules/control.nix
Normal file
119
modules/control.nix
Normal file
@@ -0,0 +1,119 @@
|
||||
{ lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
options.control = {
|
||||
homeassistant.enable = mkEnableOption "Home Assistant";
|
||||
|
||||
jellyfin.enable = mkEnableOption "Jellyfin";
|
||||
|
||||
gitea.enable = mkEnableOption "Gitea";
|
||||
|
||||
navidrome = {
|
||||
enable = mkEnableOption "Navidrome";
|
||||
|
||||
musicFolder = mkOption {
|
||||
type = types.str;
|
||||
default = "/srv/navidrome/music";
|
||||
description = "Folder containing music files.";
|
||||
};
|
||||
|
||||
dataFolder = mkOption {
|
||||
type = types.str;
|
||||
default = "/srv/navidrome/data";
|
||||
description = "Folder for Navidrome state/data.";
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 4533;
|
||||
description = "Navidrome listen port.";
|
||||
};
|
||||
|
||||
openFirewall = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Open Navidrome port in firewall.";
|
||||
};
|
||||
};
|
||||
|
||||
vaultwarden = {
|
||||
enable = mkEnableOption "Vaultwarden";
|
||||
|
||||
domain = mkOption {
|
||||
type = types.str;
|
||||
default = "http://vaultwarden.local";
|
||||
description = "External URL used by Vaultwarden.";
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 8222;
|
||||
description = "Vaultwarden listen port.";
|
||||
};
|
||||
|
||||
openFirewall = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Open Vaultwarden port in firewall.";
|
||||
};
|
||||
};
|
||||
|
||||
nextcloud = {
|
||||
enable = mkEnableOption "Nextcloud";
|
||||
|
||||
hostName = mkOption {
|
||||
type = types.str;
|
||||
default = "nextcloud.local";
|
||||
description = "Hostname served by Nextcloud.";
|
||||
};
|
||||
|
||||
adminPassFile = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
default = null;
|
||||
description = "Path to file containing Nextcloud admin password.";
|
||||
};
|
||||
|
||||
openFirewall = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Open HTTP(S) ports used by Nextcloud.";
|
||||
};
|
||||
};
|
||||
|
||||
k3s = {
|
||||
enable = mkEnableOption "k3s";
|
||||
|
||||
role = mkOption {
|
||||
type = types.enum [ "server" "agent" ];
|
||||
default = "server";
|
||||
description = "k3s node role.";
|
||||
};
|
||||
|
||||
clusterInit = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Initialize a new k3s cluster on this node.";
|
||||
};
|
||||
|
||||
serverAddr = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = "k3s server address for joining an existing cluster.";
|
||||
};
|
||||
|
||||
tokenFile = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
default = null;
|
||||
description = "Path to file containing shared k3s token.";
|
||||
};
|
||||
|
||||
openFirewall = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Open k3s ports in the firewall.";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user