feat: added per service enable options for reverseProxy configs

This commit is contained in:
Leyla Becker 2025-10-25 02:31:11 -05:00
parent 7f74060713
commit ecec04a9ce
8 changed files with 52 additions and 8 deletions

View file

@ -14,9 +14,13 @@
description = "extra domains that should be configured for actual"; description = "extra domains that should be configured for actual";
default = []; default = [];
}; };
reverseProxy.enable = lib.mkOption {
type = lib.types.bool;
default = config.services.actual.enable && config.services.reverseProxy.enable;
};
}; };
config = lib.mkIf (config.services.actual.enable && config.services.reverseProxy.enable) { config = lib.mkIf config.services.actual.reverseProxy.enable {
services.reverseProxy.services.actual = { services.reverseProxy.services.actual = {
target = "http://localhost:${toString config.services.actual.settings.port}"; target = "http://localhost:${toString config.services.actual.settings.port}";
domain = config.services.actual.domain; domain = config.services.actual.domain;

View file

@ -8,6 +8,10 @@
in { in {
options.services.forgejo = { options.services.forgejo = {
reverseProxy = { reverseProxy = {
enable = lib.mkOption {
type = lib.types.bool;
default = config.services.forgejo.enable && config.services.reverseProxy.enable;
};
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.str; type = lib.types.str;
description = "domain that forgejo will be hosted at"; description = "domain that forgejo will be hosted at";
@ -21,7 +25,7 @@ in {
}; };
}; };
config = lib.mkIf (config.services.forgejo.enable && config.services.reverseProxy.enable) { config = lib.mkIf config.services.forgejo.reverseProxy.enable {
services.reverseProxy.services.forgejo = { services.reverseProxy.services.forgejo = {
target = "http://localhost:${toString httpPort}"; target = "http://localhost:${toString httpPort}";
domain = config.services.forgejo.reverseProxy.domain; domain = config.services.forgejo.reverseProxy.domain;

View file

@ -14,9 +14,15 @@
description = "extra domains that should be configured for home-assistant"; description = "extra domains that should be configured for home-assistant";
default = []; default = [];
}; };
reverseProxy = {
enable = lib.mkOption {
type = lib.types.bool;
default = config.services.reverseProxy.enable && config.services.home-assistant.enable;
};
};
}; };
config = lib.mkIf (config.services.reverseProxy.enable && config.services.home-assistant.enable) { config = lib.mkIf config.services.home-assistant.reverseProxy.enable {
services.reverseProxy.services.home-assistant = { services.reverseProxy.services.home-assistant = {
target = "http://localhost:${toString config.services.home-assistant.config.http.server_port}"; target = "http://localhost:${toString config.services.home-assistant.config.http.server_port}";
domain = config.services.home-assistant.domain; domain = config.services.home-assistant.domain;

View file

@ -14,9 +14,15 @@
description = "extra domains that should be configured for immich"; description = "extra domains that should be configured for immich";
default = []; default = [];
}; };
reverseProxy = {
enable = lib.mkOption {
type = lib.types.bool;
default = config.services.immich.enable && config.services.reverseProxy.enable;
};
};
}; };
config = lib.mkIf (config.services.immich.enable && config.services.reverseProxy.enable) { config = lib.mkIf config.services.immich.reverseProxy.enable {
services.reverseProxy.services.immich = { services.reverseProxy.services.immich = {
target = "http://localhost:${toString config.services.immich.port}"; target = "http://localhost:${toString config.services.immich.port}";
domain = config.services.immich.domain; domain = config.services.immich.domain;

View file

@ -16,9 +16,15 @@ in {
description = "extra domains that should be configured for jellyfin"; description = "extra domains that should be configured for jellyfin";
default = []; default = [];
}; };
reverseProxy = {
enable = lib.mkOption {
type = lib.types.bool;
default = config.services.jellyfin.enable && config.services.reverseProxy.enable;
};
};
}; };
config = lib.mkIf (config.services.jellyfin.enable && config.services.reverseProxy.enable) { config = lib.mkIf config.services.jellyfin.reverseProxy.enable {
services.reverseProxy.services.jellyfin = { services.reverseProxy.services.jellyfin = {
target = "http://localhost:${toString jellyfinPort}"; target = "http://localhost:${toString jellyfinPort}";
domain = config.services.jellyfin.domain; domain = config.services.jellyfin.domain;

View file

@ -14,9 +14,15 @@
description = "extra domains that should be configured for panoramax"; description = "extra domains that should be configured for panoramax";
default = []; default = [];
}; };
reverseProxy = {
enable = lib.mkOption {
type = lib.types.bool;
default = config.services.panoramax.enable && config.services.reverseProxy.enable;
};
};
}; };
config = lib.mkIf (config.services.panoramax.enable && config.services.reverseProxy.enable) { config = lib.mkIf config.services.panoramax.reverseProxy.enable {
services.reverseProxy.services.panoramax = { services.reverseProxy.services.panoramax = {
target = "http://localhost:${toString config.services.panoramax.port}"; target = "http://localhost:${toString config.services.panoramax.port}";
domain = config.services.panoramax.domain; domain = config.services.panoramax.domain;

View file

@ -9,9 +9,15 @@
description = "extra domains that should be configured for paperless"; description = "extra domains that should be configured for paperless";
default = []; default = [];
}; };
reverseProxy = {
enable = lib.mkOption {
type = lib.types.bool;
default = config.services.paperless.enable && config.services.reverseProxy.enable;
};
};
}; };
config = lib.mkIf (config.services.paperless.enable && config.services.reverseProxy.enable) { config = lib.mkIf config.services.paperless.reverseProxy.enable {
services.reverseProxy.services.paperless = { services.reverseProxy.services.paperless = {
target = "http://${config.services.paperless.address}:${toString config.services.paperless.port}"; target = "http://${config.services.paperless.address}:${toString config.services.paperless.port}";
domain = config.services.paperless.domain; domain = config.services.paperless.domain;

View file

@ -9,9 +9,15 @@
description = "extra domains that should be configured for searx"; description = "extra domains that should be configured for searx";
default = []; default = [];
}; };
reverseProxy = {
enable = lib.mkOption {
type = lib.types.bool;
default = config.services.searx.enable && config.services.reverseProxy.enable;
};
};
}; };
config = lib.mkIf (config.services.searx.enable && config.services.reverseProxy.enable) { config = lib.mkIf config.services.searx.reverseProxy.enable {
services.reverseProxy.services.searx = { services.reverseProxy.services.searx = {
target = "http://localhost:${toString config.services.searx.settings.server.port}"; target = "http://localhost:${toString config.services.searx.settings.server.port}";
domain = config.services.searx.domain; domain = config.services.searx.domain;