some formatting

This commit is contained in:
Danilo Reyes 2025-01-22 16:38:15 -06:00
parent e1be43a0a5
commit cdd9dac355
25 changed files with 29 additions and 57 deletions

View File

@ -1,4 +1,4 @@
{ inputs, pkgs, ... }: { pkgs, ... }:
{ {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix

View File

@ -13,7 +13,7 @@
}; };
config = config =
let let
download = inputs.jawz-scripts.packages.x86_64-linux.download; inherit (inputs.jawz-scripts.packages.x86_64-linux) download;
in in
{ {
home-manager.users.jawz = { home-manager.users.jawz = {

View File

@ -10,7 +10,7 @@
options.my.units.stream-dl.enable = lib.mkEnableOption "enable"; options.my.units.stream-dl.enable = lib.mkEnableOption "enable";
config = config =
let let
stream-dl = inputs.jawz-scripts.packages.x86_64-linux.stream-dl; inherit (inputs.jawz-scripts.packages.x86_64-linux) stream-dl;
in in
{ {
systemd.user = lib.mkIf config.my.units.stream-dl.enable { systemd.user = lib.mkIf config.my.units.stream-dl.enable {

View File

@ -36,7 +36,7 @@
description = "Updates the IP of all my domains"; description = "Updates the IP of all my domains";
package = package =
let let
update-dns = inputs.jawz-scripts.packages.x86_64-linux.update-dns; inherit (inputs.jawz-scripts.packages.x86_64-linux) update-dns;
in in
pkgs.writeScriptBin "update-dns" '' pkgs.writeScriptBin "update-dns" ''
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell

View File

@ -30,9 +30,7 @@ in
}; };
}; };
}; };
nginx.virtualHosts."cache.rotehaare.art" = lib.mkIf cfg.enableProxy ( nginx.virtualHosts."cache.rotehaare.art" = lib.mkIf cfg.enableProxy (setup.proxyReverseFix cfg);
setup.proxyReverseFix cfg // { }
);
}; };
}; };
} }

View File

@ -6,7 +6,6 @@ in
{ {
options.my.servers.audiobookshelf = setup.mkOptions "audiobookshelf" "audiobooks" 5687; options.my.servers.audiobookshelf = setup.mkOptions "audiobookshelf" "audiobooks" 5687;
config = { config = {
my.servers.audiobookshelf.ip = "127.0.0.3";
services = { services = {
audiobookshelf = lib.mkIf cfg.enable { audiobookshelf = lib.mkIf cfg.enable {
inherit (cfg) port; inherit (cfg) port;
@ -14,22 +13,7 @@ in
host = cfg.ip; host = cfg.ip;
group = "piracy"; group = "piracy";
}; };
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy ( nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverseFix cfg);
setup.proxy {
"/" = {
proxyPass = cfg.local;
extraConfig = ''
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_redirect http:// https://;
'';
};
}
);
}; };
}; };
} }

View File

@ -12,7 +12,7 @@ in
enable = true; enable = true;
group = "piracy"; group = "piracy";
}; };
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg // { }); nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg);
}; };
}; };
} }

View File

@ -47,8 +47,8 @@ in
}; };
services.nginx = { services.nginx = {
virtualHosts = lib.mkIf (cfg.enableProxy || cfgS.enableProxy) { virtualHosts = lib.mkIf (cfg.enableProxy || cfgS.enableProxy) {
"${cfg.host}" = setup.proxyReverse cfg // { }; "${cfg.host}" = setup.proxyReverse cfg;
"${cfgS.host}" = setup.proxyReverse cfgS // { }; "${cfgS.host}" = setup.proxyReverse cfgS;
}; };
}; };
}; };

View File

@ -22,7 +22,7 @@ in
|> builtins.filter (file: builtins.match ".*\\.nix" file != null) |> builtins.filter (file: builtins.match ".*\\.nix" file != null)
|> map (file: import ./homepage/bookmarks/${file}); |> map (file: import ./homepage/bookmarks/${file});
}; };
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg // { }); nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg);
}; };
}; };
} }

View File

@ -7,7 +7,7 @@
}: }:
let let
cfg = config.my.servers.jellyfin; cfg = config.my.servers.jellyfin;
sub-sync = inputs.jawz-scripts.packages.x86_64-linux.sub-sync; inherit (inputs.jawz-scripts.packages.x86_64-linux) sub-sync;
sub-sync-path = [ sub-sync-path = [
pkgs.nix pkgs.nix
pkgs.bash pkgs.bash

View File

@ -24,7 +24,7 @@ in
enable = true; enable = true;
tokenKeyFile = config.sops.secrets.kavita-token.path; tokenKeyFile = config.sops.secrets.kavita-token.path;
}; };
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg // { }); nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg);
}; };
}; };
} }

View File

@ -29,8 +29,6 @@ in
"--network=host" "--network=host"
]; ];
}; };
services.nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy ( services.nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverseFix cfg);
setup.proxyReverseFix cfg // { }
);
}; };
} }

View File

@ -22,8 +22,6 @@ in
}; };
volumes = [ "${config.my.containerData}/maloja:/mljdata" ]; volumes = [ "${config.my.containerData}/maloja:/mljdata" ];
}; };
services.nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy ( services.nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg);
setup.proxyReverse cfg // { }
);
}; };
} }

View File

@ -27,7 +27,7 @@ in
}; };
credentialsFile = config.sops.secrets.mealie.path; credentialsFile = config.sops.secrets.mealie.path;
}; };
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg // { }); nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg);
}; };
}; };
} }

View File

@ -21,8 +21,6 @@ in
PGID = toString config.users.groups.piracy.gid; PGID = toString config.users.groups.piracy.gid;
}; };
}; };
services.nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy ( services.nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg);
setup.proxyReverse cfg // { }
);
}; };
} }

View File

@ -20,7 +20,7 @@ in
MICROBIN_ENCRYPTION_SERVER_SIDE = true; MICROBIN_ENCRYPTION_SERVER_SIDE = true;
}; };
}; };
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg // { }); nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg);
}; };
}; };
} }

View File

@ -23,8 +23,6 @@ in
}; };
volumes = [ "${config.my.containerData}/multi-scrobbler:/config" ]; volumes = [ "${config.my.containerData}/multi-scrobbler:/config" ];
}; };
services.nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy ( services.nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg);
setup.proxyReverse cfg // { }
);
}; };
} }

View File

@ -20,7 +20,7 @@ in
inherit (cfg) port; inherit (cfg) port;
secretKeyFile = config.sops.secrets."private_cache_keys/miniserver".path; secretKeyFile = config.sops.secrets."private_cache_keys/miniserver".path;
}; };
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg // { }); nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg);
}; };
}; };
} }

View File

@ -9,10 +9,10 @@ in
services = { services = {
ombi = lib.mkIf cfg.enable { ombi = lib.mkIf cfg.enable {
enable = true; enable = true;
port = 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

@ -23,7 +23,7 @@ in
package = pkgs.nur.repos.xddxdd.flaresolverr-21hsmw; package = pkgs.nur.repos.xddxdd.flaresolverr-21hsmw;
openFirewall = true; openFirewall = true;
}; };
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverseFix cfg // { }); nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverseFix cfg);
}; };
}; };
} }

View File

@ -12,7 +12,7 @@ in
enable = true; enable = true;
group = "piracy"; group = "piracy";
}; };
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverseFix cfg // { }); nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverseFix cfg);
}; };
}; };
} }

View File

@ -19,8 +19,6 @@ in
}; };
volumes = [ "${config.my.postgresSocket}:${config.my.postgresSocket}" ]; volumes = [ "${config.my.postgresSocket}:${config.my.postgresSocket}" ];
}; };
services.nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy ( services.nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg);
setup.proxyReverse cfg // { }
);
}; };
} }

View File

@ -15,7 +15,7 @@ in
environmentFile = config.sops.secrets.shiori.path; environmentFile = config.sops.secrets.shiori.path;
databaseUrl = "postgres:///shiori?host=${config.my.postgresSocket}"; databaseUrl = "postgres:///shiori?host=${config.my.postgresSocket}";
}; };
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg // { }); nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg);
}; };
}; };
} }

View File

@ -10,9 +10,9 @@ in
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);
}; };
}; };
} }

View File

@ -31,7 +31,7 @@ in
LOG_LEVEL = "warn"; LOG_LEVEL = "warn";
}; };
}; };
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg // { }); nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverse cfg);
}; };
}; };
} }