Compare commits
3 Commits
a93c789278
...
11cacffe7d
| Author | SHA1 | Date | |
|---|---|---|---|
|
11cacffe7d
|
|||
|
4881780186
|
|||
|
f83e1170af
|
@@ -45,6 +45,8 @@
|
||||
./services/graphing-calculator.nix
|
||||
|
||||
./services/ssh.nix
|
||||
|
||||
./services/syncthing.nix
|
||||
];
|
||||
|
||||
services.kmscon.enable = true;
|
||||
|
||||
30
flake.lock
generated
30
flake.lock
generated
@@ -281,11 +281,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1767838769,
|
||||
"narHash": "sha256-KCLU6SUU80tEBKIVZsBrSjRYX6kn1eVIYI3fEEqOp24=",
|
||||
"lastModified": 1768357481,
|
||||
"narHash": "sha256-LpOWVXsHx20x8eRIhn23Q0icmV3Z6ZeFpAPzEqldXFk=",
|
||||
"owner": "Infinidoge",
|
||||
"repo": "nix-minecraft",
|
||||
"rev": "4da21f019f6443f513f16af7f220ba4db1cdfc04",
|
||||
"rev": "f888492aa1a1eeb0114cf78af40d44e8300e002e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -296,11 +296,11 @@
|
||||
},
|
||||
"nixos-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1767185284,
|
||||
"narHash": "sha256-ljDBUDpD1Cg5n3mJI81Hz5qeZAwCGxon4kQW3Ho3+6Q=",
|
||||
"lastModified": 1768499669,
|
||||
"narHash": "sha256-jJr/zDxu5evfQxlXtMrFFF68/RNj1UrctS/eIsay4k0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "40b1a28dce561bea34858287fbb23052c3ee63fe",
|
||||
"rev": "7297dfc69ae9b06e984a6f69900ce25e67c76f46",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -328,11 +328,11 @@
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1768242861,
|
||||
"narHash": "sha256-F4IIxa5xDHjtrmMcayM8lHctUq1oGltfBQu2+oqDWP4=",
|
||||
"lastModified": 1768323494,
|
||||
"narHash": "sha256-yBXJLE6WCtrGo7LKiB6NOt6nisBEEkguC/lq/rP3zRQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "1327e798cb055f96f92685df444e9a2c326ab5ed",
|
||||
"rev": "2c3e5ec5df46d3aeee2a1da0bfedd74e21f4bf3a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -465,11 +465,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1768182633,
|
||||
"narHash": "sha256-hH2yT/KOwvw6kpJ9S68KEqq4G//o3tisL/1y1W3QbMA=",
|
||||
"lastModified": 1768440751,
|
||||
"narHash": "sha256-knz1rmABSqexRmUVWSXJvvl1eDCjyjIW1uW4oxVCpn0=",
|
||||
"owner": "nix-community",
|
||||
"repo": "srvos",
|
||||
"rev": "43dd76be5957fea8db9a1948c182597c7db81f97",
|
||||
"rev": "01120041b929c1e4160cdcd733cac7f02fb98881",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -541,11 +541,11 @@
|
||||
"trackerlist": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1768259319,
|
||||
"narHash": "sha256-kB+XRKahig2LTD14ypfYbR1QsOel6E35lIxLENleV/E=",
|
||||
"lastModified": 1768432115,
|
||||
"narHash": "sha256-UMu8BPvtjNFnccvxPHvefgboCqov98T+R8pXlaxg4y8=",
|
||||
"owner": "ngosang",
|
||||
"repo": "trackerslist",
|
||||
"rev": "3f5537d696a42c5a4a97dc9c7abf0a82fcce40eb",
|
||||
"rev": "00a9f5521ff521c023439e36f44b2d022432f0e1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -110,6 +110,9 @@
|
||||
soulseek_listen = 50300;
|
||||
llama_cpp = 8991;
|
||||
vaultwarden = 8222;
|
||||
syncthing_gui = 8384;
|
||||
syncthing_protocol = 22000;
|
||||
syncthing_discovery = 21027;
|
||||
};
|
||||
|
||||
https = {
|
||||
@@ -160,6 +163,11 @@
|
||||
monero = {
|
||||
dataDir = services_dir + "/monero";
|
||||
};
|
||||
|
||||
syncthing = {
|
||||
dataDir = services_dir + "/syncthing";
|
||||
signalBackupDir = "/${zpool_ssds}/bak/signal";
|
||||
};
|
||||
};
|
||||
|
||||
pkgs = import nixpkgs {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(lib.serviceMountWithZpool "monero" service_configs.zpool_ssds [
|
||||
(lib.serviceMountWithZpool "monero" service_configs.zpool_hdds [
|
||||
service_configs.monero.dataDir
|
||||
])
|
||||
];
|
||||
|
||||
52
services/syncthing.nix
Normal file
52
services/syncthing.nix
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
service_configs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(lib.serviceMountWithZpool "syncthing" service_configs.zpool_ssds [
|
||||
service_configs.syncthing.dataDir
|
||||
service_configs.syncthing.signalBackupDir
|
||||
])
|
||||
];
|
||||
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
|
||||
dataDir = service_configs.syncthing.dataDir;
|
||||
|
||||
guiAddress = "127.0.0.1:${toString service_configs.ports.syncthing_gui}";
|
||||
|
||||
overrideDevices = false;
|
||||
overrideFolders = false;
|
||||
|
||||
settings = {
|
||||
gui = {
|
||||
insecureSkipHostcheck = true; # Allow access via reverse proxy
|
||||
};
|
||||
options = {
|
||||
urAccepted = 1; # enable usage reporting
|
||||
relaysEnabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Open firewall ports for syncthing protocol
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ service_configs.ports.syncthing_protocol ];
|
||||
allowedUDPPorts = [ service_configs.ports.syncthing_discovery ];
|
||||
};
|
||||
|
||||
services.caddy.virtualHosts."syncthing.${service_configs.https.domain}".extraConfig = ''
|
||||
import ${config.age.secrets.caddy_auth.path}
|
||||
reverse_proxy :${toString service_configs.ports.syncthing_gui}
|
||||
'';
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"Z ${service_configs.syncthing.dataDir} 0750 ${config.services.syncthing.user} ${config.services.syncthing.group}"
|
||||
"Z ${service_configs.syncthing.signalBackupDir} 0750 ${config.services.syncthing.user} ${config.services.syncthing.group}"
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user