1 { pkgs, lib, config, hostName, ... }:
5 shell = config.users.users.root.shell;
6 group = config.users.groups.disk.name;
7 openssh.authorizedKeys.keys = [
8 (lib.readFile ../pumpkin/syncoid/ssh.key.pub)
11 # Trigger import when disks are plugged
12 services.udev.extraRules = ''
13 SUBSYSTEM=="block", KERNEL=="sd*", ENV{ID_SERIAL}=="Samsung_SSD_860_EVO_1TB_S3Z9NR0N508159W", \
14 ACTION=="add", ENV{SYSTEMD_WANTS}+="zfs-import@off2.service"
15 SUBSYSTEM=="block", KERNEL=="sd*", ENV{ID_SERIAL}=="Samsung_SSD_860_EVO_1TB_S3Z9NR0N508159W", \
16 ACTION=="remove", RUN+="${pkgs.systemd}/bin/systemctl stop --no-block zfs-import@off2.service"
18 # Setup permissions on disk off2
19 systemd.services."zfs-import@".serviceConfig.ExecStartPost = pkgs.writeShellScript "zfs-allow" ''
23 (off2) zfs allow -u ${config.users.users.backup.name} change-key,compression,create,destroy,mount,mountpoint,receive,rollback "$pool"/julm/backup;;
26 systemd.tmpfiles.rules = [
27 "z /dev/zfs 0660 - ${config.users.groups."disk".name} -"
29 systemd.services.sanoid.serviceConfig.SupplementaryGroups = [
30 config.users.groups."disk".name
34 extraArgs = [ "--verbose" ];
36 "${hostName}/home" = {
64 "off2/julm/public" = {
84 "off2/julm/backup/das1/julm/perso" = {
94 "off2/julm/backup/das1/julm/public" = {
104 "off2/julm/backup/losurdo" = {
114 "off2/julm/backup/mermet" = {
124 "off2/julm/backup/oignon" = {
133 "off2/julm/backup/pumpkin" = {