add syncoid config

This commit is contained in:
2026-06-26 14:10:52 +02:00
parent 87a09834a2
commit d5a4f5bdd1
2 changed files with 32 additions and 8 deletions

8
flake.lock generated
View File

@ -28,11 +28,11 @@
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1781713404,
"narHash": "sha256-sWYN0mtke4pMa/v19CXTYIhmZ8zIeYfcmzkSvtgBrhI=",
"lastModified": 1782248098,
"narHash": "sha256-qIvObIIVv+AGH2cKeqfbAfzAe02xR3gGWa26aQhqW5Q=",
"ref": "refs/heads/master",
"rev": "64b2f04f8f1d3f826a5fe2c456dab41f5a13b3dc",
"revCount": 41,
"rev": "c4f3c129f108bb0b8b845b09ada7cda2ce0428c9",
"revCount": 42,
"type": "git",
"url": "https://git.tmoron.fr/tom/dockermcmgr"
},

View File

@ -6,11 +6,11 @@
# By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2025/09/06 00:57:09 by tomoron #+# #+# #
# Updated: 2026/06/15 12:34:42 by tomoron ### ########.fr #
# Updated: 2026/06/24 20:34:47 by tomoron ### ########.fr #
# #
# **************************************************************************** #
{ config, pkgs, inputs, ... }:
{ lib, config, pkgs, inputs, ... }:
let
ports = [
@ -110,6 +110,31 @@ in
autosnap = true;
autoprune = true;
};
services.sanoid.datasets."raid_vol/crit" = {
daily = 31;
hourly = 24;
monthly = 12;
autosnap = true;
autoprune = true;
};
users.users.backup.isNormalUser = true;
services.syncoid.enable = true;
services.syncoid.user = "backup";
services.syncoid.group = "users";
services.syncoid.service.serviceConfig = {
BindReadOnlyPaths = [ "/home/backup/.ssh" ];
ProtectHome = lib.mkForce false;
};
services.syncoid.sshKey = "/home/backup/.ssh/id_ed25519";
services.syncoid.commands."raid_vol-critical" = {
source = "raid_vol/crit";
target = "sync@192.168.1.41:stor";
};
networking = {
hostName = "server";
@ -117,8 +142,7 @@ in
interfaces.eth0.ipv4.addresses = [ {
address = "192.168.1.24";
prefixLength = 24;
}
];
} ];
defaultGateway.address = "192.168.1.254";
defaultGateway.interface = "eth0";
nameservers = ["8.8.8.8" "8.8.4.4" "1.1.1.1"];