refactor: moved subdomain options into proxy file

This commit is contained in:
Leyla Becker 2025-09-16 10:44:00 -05:00
parent dfdd6bcc82
commit 9b02e30080
16 changed files with 84 additions and 73 deletions

View file

@ -15,14 +15,6 @@ in {
./impermanence.nix
];
options.services.forgejo = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that forgejo will be hosted at";
default = "forgejo";
};
};
config = lib.mkIf config.services.forgejo.enable {
assertions = [
{

View file

@ -6,6 +6,14 @@
const = import ./const.nix;
httpPort = const.httpPort;
in {
options.services.forgejo = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that forgejo will be hosted at";
default = "forgejo";
};
};
config = lib.mkIf (config.services.forgejo.enable && config.host.reverse_proxy.enable) {
host.reverse_proxy.subdomains.${config.services.forgejo.subdomain} = {
target = "http://localhost:${toString httpPort}";