1 { pkgs, lib, config, inputs, hostName, ... }:
3 inherit (config.users) users;
4 pumpkin2off2 = conf: lib.mapAttrs (_n: v: lib.recursiveUpdate v conf) {
5 "pumpkin/root" = let targetHost = "aubergine.local"; in {
6 target = "backup@${targetHost}:off2/julm/backup/pumpkin";
10 "--create-bookmark" "--no-sync-snap" "--no-privilege-elevation"
11 "--preserve-properties" "--preserve-recordsize"
12 "--recursive" "--sendoptions=w" "--recvoptions=u"
13 "--exclude" "pumpkin/root/nix"
14 "--exclude" "pumpkin/root/var/cache"
15 "--exclude" "pumpkin/root/var/log"
16 "--exclude" "pumpkin/root/home/julm/.cache"
17 "--sshconfig" "${pkgs.writeText "ssh-config" ''
19 Ciphers aes128-gcm@openssh.com
21 StrictHostKeyChecking yes
22 UserKnownHostsFile ${pkgs.writeText "known_hosts" ''
23 ${targetHost} ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN/cT/L3dF7uoR3s7NB59NiKjuk35I6x+7MK5zhwOy6k
31 networking.nftables.ruleset = lib.mkAfter ''
34 skuid @nixos_syncoid_uids \
37 comment "syncoid: SSH"
41 systemd.tmpfiles.rules = [
42 "z /dev/zfs 0660 - ${config.users.groups."disk".name} -"
44 # ExplanationNote: give access to /var/run/avahi-daemon/socket
45 # Using /var/run is not working due to RootDirectoryStartOnly=true
46 systemd.services.syncoid-pumpkin-root.serviceConfig.BindReadOnlyPaths = [ "/var/run" ];
47 systemd.services.syncoid-pumpkin-root.serviceConfig.RootDirectoryStartOnly = lib.mkForce false;
48 systemd.services.syncoid-pumpkin-root.serviceConfig.ExecStartPost = pkgs.writeShellScript "zfs-fix-bookmarks" ''
50 for s in $(zfs list -Hrpt snapshot -o name pumpkin); do
51 zfs bookmark "$s" "''${s//@/#}" || true
56 interval = "*-*-* *:05:00";
58 sshKey = "ssh.key:${syncoid/ssh.key.cred}";
63 #"--no-privilege-elevation"
65 #"--preserve-recordsize"
66 #"--preserve-properties"
69 serviceConfig.Group = config.users.groups."disk".name;