This commit is contained in:
Joakim Repomaa
2025-02-12 20:58:42 +02:00
parent dd4e5c63e3
commit c519f8d83e
17 changed files with 182 additions and 252 deletions

View File

@@ -1,26 +1,19 @@
{ config, lib, ... }:
let
cfg = config.modules.services.invidious;
cfg = config.services.invidious;
fqdn = "${cfg.subdomain}.${config.networking.domain}";
in
{
options.modules.services.invidious = {
enable = lib.mkEnableOption "Enable Invidious";
options.services.invidious = {
subdomain = lib.mkOption {
type = lib.types.str;
};
port = lib.mkOption {
type = lib.types.int;
default = 3000;
};
};
config = lib.mkIf cfg.enable {
services.invidious = {
enable = true;
domain = fqdn;
address = "127.0.0.1";
inherit (cfg) port;
settings = {
external_port = 443;
@@ -33,7 +26,7 @@ in
services.postgresql.enable = lib.mkDefault true;
modules.services.webserver = {
services.webserver = {
enable = lib.mkDefault true;
vHosts.${fqdn}.locations."/".proxyPort = cfg.port;
};