diff options
| author | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2026-01-11 08:03:03 -0600 |
|---|---|---|
| committer | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2026-01-11 08:03:03 -0600 |
| commit | c7e9ff3c853755cd3b0e8bc7443d55d222a06f80 (patch) | |
| tree | 341dd47932e840261bcea95d43420830afda9f50 /modules/services/options.nix | |
| parent | 77e7c78480f101ef043b8580a96f28ec25d5be5a (diff) | |
clean up services/networking config even more
Diffstat (limited to 'modules/services/options.nix')
| -rw-r--r-- | modules/services/options.nix | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/modules/services/options.nix b/modules/services/options.nix index 8be7c42..df8bc52 100644 --- a/modules/services/options.nix +++ b/modules/services/options.nix @@ -17,7 +17,7 @@ in { networkmanager.enable = mkEnableOption "heavier wifi daemon"; networkd = { - enable = mkEnableOption "set static IP (systemd-networkd)"; + enable = mkEnableOption "use systemd-networkd"; ssid = mkOption {type = lib.types.str;}; pskFile = mkOption {type = lib.types.str;}; @@ -61,9 +61,13 @@ in { selfhostOptions = { service_name, default_port ? null, - ... }: { - enable = mkEnableOption ""; + enable = mkEnableOption "${service_name} selfhosted service"; + + service_name = mkOption { + type = lib.types.str; + }; + bind_host = mkOption { type = ip_addr; default = "0.0.0.0"; @@ -72,29 +76,32 @@ in { type = lib.types.port; default = default_port; }; + root_url = mkOption { - type = lib.types.str; - default = with config.collinux.services.networking.tailscale; - if enable - then "http://${service_name}.${tailnet}" - else null; + type = lib.types.nullOr lib.types.str; + }; + + caddy = { + enable = mkEnableOption "Automatically create caddy configurations for this service"; + bind_tailscale = mkEnableOption "Bind the service to {service_name}.{tailnet}"; }; }; in { - magic_caddy.enable = mkEnableOption "Automatically create caddy configurations for services"; - adguard = selfhostOptions { service_name = "adguard"; default_port = 8001; }; + forgejo = selfhostOptions { service_name = "forgejo"; default_port = 8010; }; + headscale = selfhostOptions { service_name = "headscale"; default_port = 8080; }; + caddy = { enable = mkEnableOption "caddy https server"; envFile = mkOption { @@ -109,7 +116,7 @@ in { assertions = [ { assertion = with config.collinux.services.networking; (iwd.enable && !networkmanager.enable && !networkd.enable) || (!iwd.enable && networkmanager.enable && !networkd.enable) || (!iwd.enable && !networkmanager.enable && networkd.enable); - message = "only one networking method (iwd, networkmanager, static) can be active"; + message = "only one networking method (iwd, networkmanager, networkd) can be active"; } ]; }; |
