Add apps subdomain (#36)

* Add apps subdomain

* Fix formatting
This commit is contained in:
Patrick Stevens
2025-01-29 18:34:49 +00:00
committed by GitHub
parent 58b958ae86
commit 656b93b248
6 changed files with 179 additions and 9 deletions

View File

@@ -0,0 +1,32 @@
{
lib,
config,
...
}: {
options = {
services.apps-config = {
domain = lib.mkOption {
type = lib.types.str;
example = "example.com";
description = lib.mdDoc "Top-level domain to configure";
};
subdomain = lib.mkOption {
type = lib.types.str;
example = "apps";
description = lib.mdDoc "Subdomain in which to put apps";
};
port = lib.mkOption {
type = lib.types.port;
description = lib.mdDoc "App server localhost port";
default = 9521;
};
};
};
config = {
services.nginx.virtualHosts."${config.services.apps-config.subdomain}.${config.services.apps-config.domain}" = {
forceSSL = true;
enableACME = true;
root = ./static;
};
};
}