Reformat.

This commit is contained in:
Dmitry Voronin 2025-01-09 17:08:21 +03:00
parent cc23b6de16
commit 71560ca62f
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
13 changed files with 69 additions and 51 deletions

View file

@ -102,7 +102,7 @@ in
}; };
"dasha" = { "dasha" = {
path = "${cfg.dataDir}/dasha"; path = "${cfg.dataDir}/dasha";
devices = ["home"] ++ allDashaDevices; devices = [ "home" ] ++ allDashaDevices;
}; };
}; };
}; };

View file

@ -1,4 +1,5 @@
{ ... }: { { ... }:
{
config.const.host = { config.const.host = {
nginx = { nginx = {
domain = "voronind.com"; domain = "voronind.com";

View file

@ -7,9 +7,11 @@ in
inherit (cfg) sslCertificate sslCertificateKey extraConfig; inherit (cfg) sslCertificate sslCertificateKey extraConfig;
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:5001$request_uri"; proxyPass = "http://127.0.0.1:5001$request_uri";
extraConfig = cfg.allowLocal + '' extraConfig =
add_header Referrer-Policy 'origin'; cfg.allowLocal
''; + ''
add_header Referrer-Policy 'origin';
'';
}; };
}; };
} }

View file

@ -8,11 +8,13 @@ in
locations."/" = { locations."/" = {
proxyPass = "http://[::1]:631$request_uri"; proxyPass = "http://[::1]:631$request_uri";
recommendedProxySettings = false; recommendedProxySettings = false;
extraConfig = cfg.allowLocal + '' extraConfig =
proxy_set_header Host "127.0.0.1"; cfg.allowLocal
proxy_set_header X-Real-IP $remote_addr; + ''
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for; proxy_set_header Host "127.0.0.1";
''; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
'';
}; };
}; };
} }

View file

@ -8,12 +8,14 @@ in
locations."/" = { locations."/" = {
proxyPass = "http://[::1]:8123$request_uri"; proxyPass = "http://[::1]:8123$request_uri";
recommendedProxySettings = false; recommendedProxySettings = false;
extraConfig = cfg.allowLocal + '' extraConfig =
proxy_set_header Host $host; cfg.allowLocal
proxy_http_version 1.1; + ''
proxy_set_header Upgrade $http_upgrade; proxy_set_header Host $host;
proxy_set_header Connection "upgrade"; proxy_http_version 1.1;
''; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
'';
}; };
}; };
} }

View file

@ -7,11 +7,13 @@ in
inherit (cfg) sslCertificate sslCertificateKey extraConfig; inherit (cfg) sslCertificate sslCertificateKey extraConfig;
locations."/" = { locations."/" = {
tryFiles = "$uri $uri/index.html"; tryFiles = "$uri $uri/index.html";
extraConfig = cfg.allowLocal + '' extraConfig =
proxy_set_header Host "127.0.0.1"; cfg.allowLocal
proxy_set_header X-Real-IP $remote_addr; + ''
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for; proxy_set_header Host "127.0.0.1";
''; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
'';
}; };
}; };
} }

View file

@ -7,15 +7,17 @@ in
inherit (cfg) sslCertificate sslCertificateKey extraConfig; inherit (cfg) sslCertificate sslCertificateKey extraConfig;
locations."/" = { locations."/" = {
proxyPass = "http://[::1]:3001$request_uri"; proxyPass = "http://[::1]:3001$request_uri";
extraConfig = cfg.allowLocal + '' extraConfig =
proxy_set_header X-Forwarded-For $remote_addr; cfg.allowLocal
proxy_set_header Host $host; + ''
proxy_http_version 1.1; proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Connection ""; proxy_set_header Host $host;
proxy_hide_header Content-Security-Policy; proxy_http_version 1.1;
proxy_hide_header X-Frame-Options; proxy_set_header Connection "";
proxy_hide_header X-Content-Type-Options; proxy_hide_header Content-Security-Policy;
''; proxy_hide_header X-Frame-Options;
proxy_hide_header X-Content-Type-Options;
'';
}; };
}; };
} }

View file

@ -5,11 +5,13 @@ in
{ {
"resume.${cfg.domain}" = { "resume.${cfg.domain}" = {
inherit (cfg) sslCertificate sslCertificateKey extraConfig; inherit (cfg) sslCertificate sslCertificateKey extraConfig;
locations."/".extraConfig = cfg.allowLocal + '' locations."/".extraConfig =
if ($http_accept_language ~ ru) { cfg.allowLocal
return 301 https://git.voronind.com/voronind/resume/releases/download/latest/VoronindRu.pdf; + ''
} if ($http_accept_language ~ ru) {
return 301 https://git.voronind.com/voronind/resume/releases/download/latest/VoronindEn.pdf; return 301 https://git.voronind.com/voronind/resume/releases/download/latest/VoronindRu.pdf;
''; }
return 301 https://git.voronind.com/voronind/resume/releases/download/latest/VoronindEn.pdf;
'';
}; };
} }

View file

@ -9,9 +9,11 @@ in
locations = { locations = {
"~* /$" = { "~* /$" = {
inherit root; inherit root;
extraConfig = cfg.allowLocal + '' extraConfig =
autoindex on; cfg.allowLocal
''; + ''
autoindex on;
'';
}; };
"/" = { "/" = {
inherit root; inherit root;

View file

@ -7,10 +7,12 @@ in
inherit (cfg) sslCertificate sslCertificateKey extraConfig; inherit (cfg) sslCertificate sslCertificateKey extraConfig;
locations."/" = { locations."/" = {
proxyPass = "http://[::1]:8384$request_uri"; proxyPass = "http://[::1]:8384$request_uri";
extraConfig = cfg.allowLocal + '' extraConfig =
proxy_set_header Host "localhost"; cfg.allowLocal
proxy_set_header X-Forwarded-Host "localhost"; + ''
''; proxy_set_header Host "localhost";
proxy_set_header X-Forwarded-Host "localhost";
'';
}; };
}; };
} }

View file

@ -7,11 +7,13 @@ in
inherit (cfg) sslCertificate sslCertificateKey extraConfig; inherit (cfg) sslCertificate sslCertificateKey extraConfig;
locations."/" = { locations."/" = {
proxyPass = "http://[::1]:33122$request_uri"; proxyPass = "http://[::1]:33122$request_uri";
extraConfig = cfg.allowLocal + '' extraConfig =
proxy_set_header Host $host; cfg.allowLocal
proxy_set_header X-Forwarded-Host $host; + ''
proxy_set_header X-Forwarded-Proto https; proxy_set_header Host $host;
''; proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto https;
'';
}; };
}; };
} }

View file

@ -23,4 +23,3 @@
}; };
}; };
} }

View file

@ -1,5 +1,5 @@
{ config, ... }: { { config, ... }:
{
# Specify current release version. # Specify current release version.
system.stateVersion = config.const.stateVersion; system.stateVersion = config.const.stateVersion;
} }