syncthing+nx2site(trying)

This commit is contained in:
Lennart J. Kurzweg (Nx2)
2024-08-26 21:37:36 +02:00
parent 5d1d2c49e5
commit 4eead91953
6 changed files with 48 additions and 22 deletions

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -3,6 +3,10 @@
let let
in in
{ {
networking.nameservers = [
"1.1.1.1"
"8.8.8.8"
];
networking.hostName = host; networking.hostName = host;
@@ -10,5 +14,5 @@ in
enable = true; enable = true;
}; };
networking.enableIPv6 = true; networking.enableIPv6 = false;
} }

View File

@@ -1,7 +1,8 @@
{ config, pkgs, lib, user, host, ... }: { config, pkgs, lib, user, host, ... }:
lib.mkIf false # lib.mkIf false
# lib.mkIf (host == "NxACE") lib.mkIf (host == "NxACE")
((import ./nx2site/proxy.nix { inherit config pkgs lib user; }) // # ((import ./nx2site/proxy.nix { inherit config pkgs lib user; }) //
(
{ {
sops.secrets = { sops.secrets = {
"nx2site/namecheap.pw" = { }; "nx2site/namecheap.pw" = { };
@@ -115,5 +116,6 @@ lib.mkIf false
"172.1.8.1" = [ "llm.docker" ]; "172.1.8.1" = [ "llm.docker" ];
# "172.1.9.1" = [ "proxy.docker" ]; # "172.1.9.1" = [ "proxy.docker" ];
"172.1.10.1" = [ "share.docker" ]; "172.1.10.1" = [ "share.docker" ];
"172.1.11.1" = [ "odq.docker" ];
}; };
}) })

View File

@@ -1,15 +1,12 @@
{ config, pkgs, lib, user }: { config, pkgs, lib, user }:
lib.mkIf false
{ {
sops.secrets = { sops.secrets = {
"nx2site/sslCertificate.pem" = { owner = config.services.nginx.user; }; "nx2site/sslCertificate.pem" = { owner = config.services.nginx.user; };
"nx2site/sslCertificateKey.pem" = { owner = config.services.nginx.user; }; "nx2site/sslCertificateKey.pem" = { owner = config.services.nginx.user; };
"nx2site/dhparams.pem" = { owner = config.services.nginx.user; }; "nx2site/dhparams.pem" = { owner = config.services.nginx.user; };
}; };
services.nginx = let services.nginx = {
config-root = /home/${user}/nx2site/proxy/config;
xcontent-root = /home/${user}/nx2site/proxy/xcontent;
content-root = /home/${user}/nx2site/proxy/content;
in {
enable = true; enable = true;
additionalModules = []; additionalModules = [];
# appendConfig = ''''; # appendConfig = '''';
@@ -116,8 +113,7 @@
}; };
}; };
# "dev.nx2.site" = { # "dev.nx2.site" = {
# kTLS = true; http2 = true; http3 = true; http3_hq = true; quic = true; # inherit sslCertificate sslCertificateKey kTLS http2 http3 http3_hq quic;
sslCertificate = cert; sslCertificateKey = key;
# listen = [ { addr = "0.0.0.0"; port = 443; ssl = true; } ]; # listen = [ { addr = "0.0.0.0"; port = 443; ssl = true; } ];
# locations = { # locations = {
# "/" = { # "/" = {
@@ -149,7 +145,7 @@
"/socket.io" = { "/socket.io" = {
proxyPass = "http://share/socket.io"; proxyPass = "http://share/socket.io";
proxyWebsockets = true; proxyWebsockets = true;
# extraConfig = [ # extraConfig = [
# ''proxy_http_version 1.1;'' # ''proxy_http_version 1.1;''
# ''proxy_set_header Upgrade $http_upgrade;'' # ''proxy_set_header Upgrade $http_upgrade;''
# ''proxy_set_header Connection "upgrade";'' # ''proxy_set_header Connection "upgrade";''
@@ -176,9 +172,7 @@
# listen = [ { addr = "0.0.0.0"; port = 443; ssl = true; } ]; # listen = [ { addr = "0.0.0.0"; port = 443; ssl = true; } ];
root = "/home/nx2/nx2site/staticweb/xcontent/"; root = "/home/nx2/nx2site/staticweb/xcontent/";
locations = { locations = {
"~.*" = { "~.*" = { return = "502 /502.html"; };
return = "502 /502.html";
};
}; };
}; };
}; };

View File

@@ -17,7 +17,12 @@ let
}; };
dirs = { dirs = {
default = { name = "sync"; path = "/home/${user}/sync"; }; default = { name = "sync"; path = "/home/${user}/sync"; };
s21u-dcim = { name = "s21u-dcim"; path = "/vault/Pictures/Lennart"; };
diane-dcim = { name = "diane-dcim"; path = "/vault/Pictures/Diane"; };
dianesd-dcim = { name = "dianesd-dcim"; path = "/vault/Pictures/Diane-SD"; };
daniel-dcim = { name = "daniel-dcim"; path = "/vault/Pictures/Daniel"; };
tessa-dcim = { name = "tessa-dcim"; path = "/vault/Pictures/Tessa"; };
}; };
in in
lib.mkIf (user != "tv") lib.mkIf (user != "tv")
@@ -45,8 +50,7 @@ lib.mkIf (user != "tv")
) else if (host == "NxNORTH") then ( ) else if (host == "NxNORTH") then (
xps // ace // s21u xps // ace // s21u
) else ( ) else (
# north // xps // s21u // diane // daniel // tessa // georg north // xps // s21u // diane // daniel // tessa // georg
north // xps // s21u
); );
folders = with dirs; if (host == "NxXPS") then { folders = with dirs; if (host == "NxXPS") then {
"${default.name}" = { "${default.name}" = {
@@ -58,11 +62,31 @@ lib.mkIf (user != "tv")
path = default.path; path = default.path;
devices = with devices; (justname [ xps ace s21u ]); devices = with devices; (justname [ xps ace s21u ]);
}; };
} else { } else { # NxACE
"${default.name}" = { "${default.name}" = {
path = default.path; path = default.path;
devices = with devices; (justname [ xps north s21u ]); devices = with devices; (justname [ xps north s21u ]);
}; };
"${s21u-dcim.name}" = {
path = s21u-dcim.path;
devices = with devices; (justname [ s21u ]);
};
"${diane-dcim.name}" = {
path = diane-dcim.path;
devices = with devices; (justname [ diane ]);
};
"${dianesd-dcim.name}" = {
path = dianesd-dcim.path;
devices = with devices; (justname [ diane ]);
};
"${daniel-dcim.name}" = {
path = daniel-dcim.path;
devices = with devices; (justname [ daniel ]);
};
"${tessa-dcim.name}" = {
path = tessa-dcim.path;
devices = with devices; (justname [ tessa ]);
};
}; };
gui = { gui = {
theme = "black"; theme = "black";