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

@ -1,42 +1,14 @@
{ lib, config, pkgs, ... }:
let
cfg = config.ooknet.networking.tailscale;
cfg = config.ooknet.host.networking.tailscale;
inherit (config.services) tailscale;
inherit (lib.lists) optionals;
inherit (lib.types) bool listOf str;
inherit (lib.strings) concatStringsSep;
inherit (lib) mkIf mkEnableOption mkOption mkDefault;
inherit (lib) mkIf mkDefault;
in
{
options.ooknet.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 = cfg.enable;
description = "Define if the host is a client";
};
tag = mkOption {
type = listOf str;
default =
if cfg.client then ["tag:client"]
else if cfg.server then ["tag:server"]
else [];
description = "Sets host tag depending on if server/client";
};
operator = mkOption {
type = str;
default = "ooks";
description = "Name of the tailscale operator";
};
};
config = mkIf cfg.enable {
services.tailscale = {