1 { pkgs, lib, config, hostName, hosts, ... }:
3 inherit (config) networking;
4 inherit (config.services) syncoid;
5 inherit (config.security) gnupg;
6 inherit (config.users) groups;
7 losurdo2das1 = path: conf: lib.mapAttrs (n: v: lib.recursiveUpdate v conf) {
8 "${hostName}/${path}2das1" = {
9 source = "${hostName}/${path}";
10 target = "das1/julm/backup/losurdo/${path}";
15 mermet2losurdo = path: conf: lib.mapAttrs (n: v: lib.recursiveUpdate v conf) {
16 "backup@mermet.${networking.domain}:rpool/${path}" = {
17 target = "${hostName}/backup/mermet/${path}";
21 "${hostName}/backup/mermet/${path}" = {
22 target = "das1/julm/backup/mermet/${path}";
29 networking.nftables.ruleset = lib.mkAfter ''
32 skuid @nixos-syncoid-uids \
35 comment "syncoid: SSH"
39 security.gnupg.secrets."ssh/backup.ssh-ed25519" = {};
40 systemd.tmpfiles.rules = [
41 "z /dev/zfs 0660 - disk -"
45 nftables.enable = true;
46 interval = "*-*-* *:05:00";
48 sshKey = gnupg.secrets."ssh/backup.ssh-ed25519".path;
53 #"--no-privilege-elevation"
57 after = [ gnupg.secrets."ssh/backup.ssh-ed25519".service ];
58 wants = [ gnupg.secrets."ssh/backup.ssh-ed25519".service ];
59 serviceConfig.Group = groups."disk".name;
62 "${hostName}/home/julm/work" = {
64 target = "backup@mermet.${networking.domain}:rpool/backup/${hostName}/home/julm/work";
67 // mermet2losurdo "var" {
70 "--exclude=rpool/var/cache"
71 "--exclude=rpool/var/log"
72 "--exclude=rpool/var/tmp"
75 // mermet2losurdo "home/julm/mail" {}
76 // mermet2losurdo "home/julm/log" {}
77 // losurdo2das1 "home/julm/work" {}
78 // losurdo2das1 "var/sftp" {}
79 // losurdo2das1 "var/git" {}