3 sftpRoot = "/var/lib/sftp";
8 where = "${sftpRoot}/films";
10 what = "/mnt/off3/julm/public/podcasts/films";
11 options = "bind,rw,noauto";
12 requires = [ "zfs-import@off3.service" ];
14 "zfs-import@off3.service"
17 "mnt-off3-julm-public-podcasts.mount"
19 #bindsTo = [ "mnt-off3-julm-public-podcasts.mount" ];
21 #AssertDirectoryNotEmpty = "/mnt/off3/julm/public/podcasts/films";
25 systemd.automounts = [
27 where = "${sftpRoot}/films";
28 wantedBy = [ "zfs-mount.service" ];
29 after = [ "zfs-mount.service" "var-lib-sftp.mount" ];
30 #automountConfig.TimeoutIdleSec = "5 min";
33 fileSystems."${sftpRoot}/camera" = {
34 device = "/mnt/off2/julm/perso/camera";
35 options = [ "bind" "ro" "noauto" ];
37 services.openssh.extraConfig = ''
39 AllowAgentForwarding no
41 ChrootDirectory ${sftpRoot}
42 ForceCommand internal-sftp -u 0002
46 services.udev.extraRules = ''
47 SUBSYSTEM=="block", KERNEL=="sd*", ENV{ID_SERIAL}=="TOSHIBA_MK6459GSXP_519DC07HT", \
48 ACTION=="add", ENV{SYSTEMD_WANTS}+="zfs-import@off3.service"
49 SUBSYSTEM=="block", KERNEL=="sd*", ENV{ID_SERIAL}=="TOSHIBA_MK6459GSXP_519DC07HT", \
50 ACTION=="remove", RUN+="${pkgs.systemd}/bin/systemctl stop --no-block zfs-import@off3.service"