servers module linting, removed unnecesary nesting

This commit is contained in:
Danilo Reyes 2025-04-16 22:38:02 -06:00
parent 556bce8282
commit bcbf047415
6 changed files with 74 additions and 86 deletions

View File

@ -5,17 +5,15 @@ let
in in
{ {
options.my.servers.drpp = setup.mkOptions "drpp" "drpp" 0; options.my.servers.drpp = setup.mkOptions "drpp" "drpp" 0;
config = { config.virtualisation.oci-containers.containers.drpp = lib.mkIf cfg.enable {
virtualisation.oci-containers.containers.drpp = lib.mkIf cfg.enable { image = "ghcr.io/phin05/discord-rich-presence-plex:latest";
image = "ghcr.io/phin05/discord-rich-presence-plex:latest"; environment = {
environment = { DRPP_UID = toString config.users.users.jawz.uid;
DRPP_UID = toString config.users.users.jawz.uid; DRPP_GID = toString config.users.groups.users.gid;
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"
];
}; };
volumes = [
"${config.my.containerData}/drpp:/app/data"
"/run/user/${toString config.users.users.jawz.uid}:/run/app"
];
}; };
} }

View File

@ -5,14 +5,12 @@ let
in in
{ {
options.my.servers.ombi = setup.mkOptions "ombi" "requests" 3425; options.my.servers.ombi = setup.mkOptions "ombi" "requests" 3425;
config = { config.services = {
services = { ombi = lib.mkIf cfg.enable {
ombi = lib.mkIf cfg.enable { enable = true;
enable = true; inherit (cfg) port;
inherit (cfg) port; openFirewall = !cfg.isLocal;
openFirewall = !cfg.isLocal;
};
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverseFix cfg);
}; };
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverseFix cfg);
}; };
} }

View File

@ -6,17 +6,15 @@ let
in in
{ {
options.my.servers.plex-discord-bot = setup.mkOptions name name 0; options.my.servers.plex-discord-bot = setup.mkOptions name name 0;
config = { config.virtualisation.oci-containers.containers.plex-discord-bot = lib.mkIf cfg.enable {
virtualisation.oci-containers.containers.plex-discord-bot = lib.mkIf cfg.enable { image = "ghcr.io/phin05/discord-rich-presence-plex:latest";
image = "ghcr.io/phin05/discord-rich-presence-plex:latest"; environment = {
environment = { DRPP_UID = toString config.users.users.jawz.uid;
DRPP_UID = toString config.users.users.jawz.uid; DRPP_GID = toString config.users.groups.users.gid;
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"
];
}; };
volumes = [
"${config.my.containerData}/drpp:/app/data"
"/run/user/${toString config.users.users.jawz.uid}:/run/app"
];
}; };
} }

View File

@ -9,43 +9,41 @@ let
in in
{ {
options.my.servers.plex = setup.mkOptions "plex" "plex" 32400; options.my.servers.plex = setup.mkOptions "plex" "plex" 32400;
config = { config.services = {
services = { plex = lib.mkIf cfg.enable {
plex = lib.mkIf cfg.enable { enable = true;
enable = true; group = "piracy";
group = "piracy"; openFirewall = true;
openFirewall = true; };
}; nginx = lib.mkIf cfg.enableProxy {
nginx = lib.mkIf cfg.enableProxy { virtualHosts."${cfg.host}" = {
virtualHosts."${cfg.host}" = { forceSSL = true;
forceSSL = true; enableACME = true;
enableACME = true; http2 = true;
http2 = true; serverAliases = [ "plex.rotehaare.art" ];
serverAliases = [ "plex.rotehaare.art" ]; extraConfig = ''
extraConfig = '' # Some players don't reopen a socket and playback stops totally instead of resuming after an extended pause
# Some players don't reopen a socket and playback stops totally instead of resuming after an extended pause send_timeout 100m;
send_timeout 100m; # Plex headers
# Plex headers proxy_set_header X-Plex-Client-Identifier $http_x_plex_client_identifier;
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 $http_x_plex_device; proxy_set_header X-Plex-Device-Name $http_x_plex_device_name;
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 $http_x_plex_platform; proxy_set_header X-Plex-Platform-Version $http_x_plex_platform_version;
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-Product $http_x_plex_product; proxy_set_header X-Plex-Token $http_x_plex_token;
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-Version $http_x_plex_version; proxy_set_header X-Plex-Nocache $http_x_plex_nocache;
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-Provides $http_x_plex_provides; proxy_set_header X-Plex-Device-Vendor $http_x_plex_device_vendor;
proxy_set_header X-Plex-Device-Vendor $http_x_plex_device_vendor; proxy_set_header X-Plex-Model $http_x_plex_model;
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.
# Buffering off send to the client as soon as the data is received from Plex. proxy_redirect off;
proxy_redirect off; proxy_buffering off;
proxy_buffering off; '';
''; locations."/" = {
locations."/" = { proxyPass = cfg.local;
proxyPass = cfg.local; proxyWebsockets = true;
proxyWebsockets = true;
};
}; };
}; };
}; };

View File

@ -9,16 +9,14 @@ let
in in
{ {
options.my.websites.portfolio = setup.mkOptions "portfolio" "portfolio" 0; options.my.websites.portfolio = setup.mkOptions "portfolio" "portfolio" 0;
config = { config.services.nginx.virtualHosts."danilo-reyes.com" = lib.mkIf cfg.enableProxy {
services.nginx.virtualHosts."danilo-reyes.com" = lib.mkIf cfg.enableProxy { forceSSL = true;
forceSSL = true; enableACME = true;
enableACME = true; http2 = true;
http2 = true; root = "/srv/www/danilo-reyes.com";
root = "/srv/www/danilo-reyes.com"; # index = "index.html";
# index = "index.html"; locations."/".extraConfig = ''
locations."/".extraConfig = '' try_files $uri $uri/ =404;
try_files $uri $uri/ =404; '';
'';
};
}; };
} }

View File

@ -5,14 +5,12 @@ let
in in
{ {
options.my.servers.sonarr = setup.mkOptions "sonarr" "series" 8989; options.my.servers.sonarr = setup.mkOptions "sonarr" "series" 8989;
config = { config.services = {
services = { sonarr = lib.mkIf cfg.enable {
sonarr = lib.mkIf cfg.enable { enable = true;
enable = true; group = "piracy";
group = "piracy"; openFirewall = !cfg.isLocal;
openFirewall = !cfg.isLocal;
};
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverseFix cfg);
}; };
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverseFix cfg);
}; };
} }