aboutsummaryrefslogtreecommitdiff
path: root/modules/services/options.nix
diff options
context:
space:
mode:
authorCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-02-12 11:06:43 -0600
committerCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-02-12 11:06:43 -0600
commitd7a83a7dfbe71bbf5d8f2533a6d9442af9b01283 (patch)
tree7902c91fcb2b6a3b33956ad1f03b55d98ec74c6d /modules/services/options.nix
parented84fb332431c6c33891ac1b18a0b184e7d828be (diff)
clean up caddy config options for services
Diffstat (limited to 'modules/services/options.nix')
-rw-r--r--modules/services/options.nix60
1 files changed, 23 insertions, 37 deletions
diff --git a/modules/services/options.nix b/modules/services/options.nix
index 3db8f8a..174e604 100644
--- a/modules/services/options.nix
+++ b/modules/services/options.nix
@@ -11,33 +11,30 @@
default_port ? null,
}: {
enable = mkEnableOption "${service_name} selfhosted service";
-
- service_name = mkOption {
+ serviceName = mkOption {
+ internal = true;
type = lib.types.str;
default = service_name;
- internal = true;
- };
-
- bind_host = mkOption {
- description = "The IP address on which ${service_name} will listen for incoming connections. The default, `0.0.0.0`, means 'all interfaces'";
- type = ipAddr;
- default = "0.0.0.0";
};
port = mkOption {
description = "The port on which ${service_name} will listen for incomming connections";
type = lib.types.port;
default = default_port;
};
-
- root_url = mkOption {
- description = "The final url that this service will be hosted on. Required for caddy, otherwise optional";
+ listenAddr = mkOption {
+ description = "The IP address on which ${service_name} will listen for incoming connections";
+ type = ipAddr;
+ default = "127.0.0.1";
+ };
+ privateUrl = mkOption {
+ description = "Internal .local name for the service. Don't put the protocol (https://) in the string";
type = lib.types.nullOr lib.types.str;
+ default = null;
};
-
- caddy = {
- global.enable = mkEnableOption "Automatically create caddy configurations for this service";
- local.enable = mkEnableOption "Automatically make this service accessable on ${service_name}.local";
- bind_tailscale = mkEnableOption "Bind the service to ${service_name}.{tailnet}";
+ publicUrl = mkOption {
+ description = "Public website on which the service will be hosted. Don't put the protocol (https://) in the string";
+ type = lib.types.nullOr lib.types.str;
+ default = null;
};
};
in {
@@ -55,6 +52,12 @@ in {
type = lib.types.port;
};
+ listenAddr = mkOption {
+ description = "Address to listen on";
+ type = lib.types.str;
+ default = "127.0.0.1";
+ };
+
otp = mkEnableOption "Whether to require TOTP (Google Authenticator) 2fa codes for this port";
rootLogin = mkEnableOption "Whether to allow root login for this port";
};
@@ -62,23 +65,11 @@ in {
};
};
- adguard = selfhostOptions {
- service_name = "adguard";
- default_port = 8001;
+ forgejo = selfhostOptions {
+ service_name = "forgejo";
+ default_port = 8010;
};
- forgejo =
- (selfhostOptions {
- service_name = "forgejo";
- default_port = 8010;
- })
- // {
- git_ssh_port = mkOption {
- type = lib.types.port;
- default = 2225;
- };
- };
-
navidrome = selfhostOptions {
service_name = "navidrome";
default_port = 8070;
@@ -118,11 +109,6 @@ in {
};
};
- headscale = selfhostOptions {
- service_name = "headscale";
- default_port = 8080;
- };
-
caddy = {
enable = mkEnableOption "caddy https server";
envFile = mkOption {