refactor(nixos:tailcale): move options --> ooknet.host.networking.tailscale

This commit is contained in:
ooks-io 2024-06-12 22:32:58 +12:00
parent fa926b9453
commit dd6271f7d6
7 changed files with 195 additions and 224 deletions

View file

@ -3,7 +3,9 @@
let
inherit (lib) mkOption mkEnableOption;
inherit (lib.types) bool enum listOf int submodule nullOr str;
admin = config.ooknet.host.admin;
hardware = config.ooknet.host.hardware;
tailscale = config.ooknet.host.networking.tailscale;
in
{
@ -24,7 +26,7 @@ in
};
profiles = mkOption {
type = listOf (enum ["gaming" "creative" "productivity" "media-server"]);
type = listOf (enum ["gaming" "creative" "productivity" "console-tools" "media-server"]);
default = [];
};
@ -52,6 +54,35 @@ in
homeManager = mkEnableOption "";
};
networking = {
tailscale = {
enable = mkEnableOption "Enable tailscale system module";
server = mkOption {
type = bool;
default = false;
description = "Define if the host is a server";
};
client = mkOption {
type = bool;
default = tailscale.enable;
description = "Define if the host is a client";
};
tag = mkOption {
type = listOf str;
default =
if tailscale.client then ["tag:client"]
else if tailscale.server then ["tag:server"]
else [];
description = "Sets host tag depending on if server/client";
};
operator = mkOption {
type = str;
default = "${admin.name}";
description = "Name of the tailscale operator";
};
};
};
hardware = {
gpu = {
type = mkOption {