diff --git a/modules/servers/drpp.nix b/modules/servers/drpp.nix index a018d08..4dd6929 100644 --- a/modules/servers/drpp.nix +++ b/modules/servers/drpp.nix @@ -5,17 +5,15 @@ let in { options.my.servers.drpp = setup.mkOptions "drpp" "drpp" 0; - config = { - virtualisation.oci-containers.containers.drpp = lib.mkIf cfg.enable { - image = "ghcr.io/phin05/discord-rich-presence-plex:latest"; - environment = { - DRPP_UID = toString config.users.users.jawz.uid; - DRPP_GID = toString config.users.groups.users.gid; - }; - volumes = [ - "${config.my.containerData}/drpp:/app/data" - "/run/user/${toString config.users.users.jawz.uid}:/run/app" - ]; + config.virtualisation.oci-containers.containers.drpp = lib.mkIf cfg.enable { + image = "ghcr.io/phin05/discord-rich-presence-plex:latest"; + environment = { + DRPP_UID = toString config.users.users.jawz.uid; + DRPP_GID = toString config.users.groups.users.gid; }; + volumes = [ + "${config.my.containerData}/drpp:/app/data" + "/run/user/${toString config.users.users.jawz.uid}:/run/app" + ]; }; } diff --git a/modules/servers/ombi.nix b/modules/servers/ombi.nix index 115413b..e6d6117 100644 --- a/modules/servers/ombi.nix +++ b/modules/servers/ombi.nix @@ -5,14 +5,12 @@ let in { options.my.servers.ombi = setup.mkOptions "ombi" "requests" 3425; - config = { - services = { - ombi = lib.mkIf cfg.enable { - enable = true; - inherit (cfg) port; - openFirewall = !cfg.isLocal; - }; - nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverseFix cfg); + config.services = { + ombi = lib.mkIf cfg.enable { + enable = true; + inherit (cfg) port; + openFirewall = !cfg.isLocal; }; + nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverseFix cfg); }; } diff --git a/modules/servers/plex-discord-bot.nix b/modules/servers/plex-discord-bot.nix index 7151931..52ed20a 100644 --- a/modules/servers/plex-discord-bot.nix +++ b/modules/servers/plex-discord-bot.nix @@ -6,17 +6,15 @@ let in { options.my.servers.plex-discord-bot = setup.mkOptions name name 0; - config = { - virtualisation.oci-containers.containers.plex-discord-bot = lib.mkIf cfg.enable { - image = "ghcr.io/phin05/discord-rich-presence-plex:latest"; - environment = { - DRPP_UID = toString config.users.users.jawz.uid; - DRPP_GID = toString config.users.groups.users.gid; - }; - volumes = [ - "${config.my.containerData}/drpp:/app/data" - "/run/user/${toString config.users.users.jawz.uid}:/run/app" - ]; + config.virtualisation.oci-containers.containers.plex-discord-bot = lib.mkIf cfg.enable { + image = "ghcr.io/phin05/discord-rich-presence-plex:latest"; + environment = { + DRPP_UID = toString config.users.users.jawz.uid; + DRPP_GID = toString config.users.groups.users.gid; }; + volumes = [ + "${config.my.containerData}/drpp:/app/data" + "/run/user/${toString config.users.users.jawz.uid}:/run/app" + ]; }; } diff --git a/modules/servers/plex.nix b/modules/servers/plex.nix index 410c104..bfdf44a 100644 --- a/modules/servers/plex.nix +++ b/modules/servers/plex.nix @@ -9,43 +9,41 @@ let in { options.my.servers.plex = setup.mkOptions "plex" "plex" 32400; - config = { - services = { - plex = lib.mkIf cfg.enable { - enable = true; - group = "piracy"; - openFirewall = true; - }; - nginx = lib.mkIf cfg.enableProxy { - virtualHosts."${cfg.host}" = { - forceSSL = true; - enableACME = true; - http2 = true; - serverAliases = [ "plex.rotehaare.art" ]; - extraConfig = '' - # Some players don't reopen a socket and playback stops totally instead of resuming after an extended pause - send_timeout 100m; - # Plex headers - proxy_set_header X-Plex-Client-Identifier $http_x_plex_client_identifier; - proxy_set_header X-Plex-Device $http_x_plex_device; - proxy_set_header X-Plex-Device-Name $http_x_plex_device_name; - proxy_set_header X-Plex-Platform $http_x_plex_platform; - proxy_set_header X-Plex-Platform-Version $http_x_plex_platform_version; - proxy_set_header X-Plex-Product $http_x_plex_product; - proxy_set_header X-Plex-Token $http_x_plex_token; - proxy_set_header X-Plex-Version $http_x_plex_version; - proxy_set_header X-Plex-Nocache $http_x_plex_nocache; - proxy_set_header X-Plex-Provides $http_x_plex_provides; - proxy_set_header X-Plex-Device-Vendor $http_x_plex_device_vendor; - proxy_set_header X-Plex-Model $http_x_plex_model; - # Buffering off send to the client as soon as the data is received from Plex. - proxy_redirect off; - proxy_buffering off; - ''; - locations."/" = { - proxyPass = cfg.local; - proxyWebsockets = true; - }; + config.services = { + plex = lib.mkIf cfg.enable { + enable = true; + group = "piracy"; + openFirewall = true; + }; + nginx = lib.mkIf cfg.enableProxy { + virtualHosts."${cfg.host}" = { + forceSSL = true; + enableACME = true; + http2 = true; + serverAliases = [ "plex.rotehaare.art" ]; + extraConfig = '' + # Some players don't reopen a socket and playback stops totally instead of resuming after an extended pause + send_timeout 100m; + # Plex headers + proxy_set_header X-Plex-Client-Identifier $http_x_plex_client_identifier; + proxy_set_header X-Plex-Device $http_x_plex_device; + proxy_set_header X-Plex-Device-Name $http_x_plex_device_name; + proxy_set_header X-Plex-Platform $http_x_plex_platform; + proxy_set_header X-Plex-Platform-Version $http_x_plex_platform_version; + proxy_set_header X-Plex-Product $http_x_plex_product; + proxy_set_header X-Plex-Token $http_x_plex_token; + proxy_set_header X-Plex-Version $http_x_plex_version; + proxy_set_header X-Plex-Nocache $http_x_plex_nocache; + proxy_set_header X-Plex-Provides $http_x_plex_provides; + proxy_set_header X-Plex-Device-Vendor $http_x_plex_device_vendor; + proxy_set_header X-Plex-Model $http_x_plex_model; + # Buffering off send to the client as soon as the data is received from Plex. + proxy_redirect off; + proxy_buffering off; + ''; + locations."/" = { + proxyPass = cfg.local; + proxyWebsockets = true; }; }; }; diff --git a/modules/servers/portfolio.nix b/modules/servers/portfolio.nix index 792bfb4..aa8ad65 100644 --- a/modules/servers/portfolio.nix +++ b/modules/servers/portfolio.nix @@ -9,16 +9,14 @@ let in { options.my.websites.portfolio = setup.mkOptions "portfolio" "portfolio" 0; - config = { - services.nginx.virtualHosts."danilo-reyes.com" = lib.mkIf cfg.enableProxy { - forceSSL = true; - enableACME = true; - http2 = true; - root = "/srv/www/danilo-reyes.com"; - # index = "index.html"; - locations."/".extraConfig = '' - try_files $uri $uri/ =404; - ''; - }; + config.services.nginx.virtualHosts."danilo-reyes.com" = lib.mkIf cfg.enableProxy { + forceSSL = true; + enableACME = true; + http2 = true; + root = "/srv/www/danilo-reyes.com"; + # index = "index.html"; + locations."/".extraConfig = '' + try_files $uri $uri/ =404; + ''; }; } diff --git a/modules/servers/sonarr.nix b/modules/servers/sonarr.nix index 35b9405..7062eed 100644 --- a/modules/servers/sonarr.nix +++ b/modules/servers/sonarr.nix @@ -5,14 +5,12 @@ let in { options.my.servers.sonarr = setup.mkOptions "sonarr" "series" 8989; - config = { - services = { - sonarr = lib.mkIf cfg.enable { - enable = true; - group = "piracy"; - openFirewall = !cfg.isLocal; - }; - nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverseFix cfg); + config.services = { + sonarr = lib.mkIf cfg.enable { + enable = true; + group = "piracy"; + openFirewall = !cfg.isLocal; }; + nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverseFix cfg); }; }