diff --git a/hosts/docker/configuration.nix b/hosts/docker/configuration.nix index ac8e1b8..d6d8b88 100644 --- a/hosts/docker/configuration.nix +++ b/hosts/docker/configuration.nix @@ -26,6 +26,7 @@ in # ../../modules/nix/tailscale-service.nix ../../modules/tailscale/enable-service.nix ../../modules/rotate-traefik-logs.nix + ../../modules/raspi/mount-data.nix ]; @@ -40,54 +41,32 @@ boot.zfs.forceImportRoot = false; nfs-utils ]; - # services.logrotate = { - # enable = true; - - # settings = { - # "/mnt/docker-volumes/traefik-data/logs/*.log" = { - # daily = true; - # size = "100M"; - # rotate = 20; - # compress = true; - # missingok = true; - # notifempty = true; - # copytruncate = true; - # }; - - # }; - # }; - - + boot.supportedFilesystems = [ "nfs" ]; services.rpcbind.enable = true; - # Mount docker persistent data - # fileSystems."/mnt/docker-persistent-data" = { - # device = "/dev/disk/by-label/docker-data"; - # fsType = "ext4"; - # options = [ "defaults" "nofail" "noatime" ]; - # }; -fileSystems."/mnt/raspi" = { - device = "raspberrypi.tail13f623.ts.net:/home/raspi/raspi"; - fsType = "nfs4"; - options = [ - "nofail" - "_netdev" - "noatime" - # Don't mount until first access - "x-systemd.automount" +# fileSystems."/mnt/raspi" = { +# device = "raspberrypi.tail13f623.ts.net:/home/raspi/raspi"; +# fsType = "nfs4"; +# options = [ +# "nofail" +# "_netdev" +# "noatime" - # Unmount after 10 min idle - "x-systemd.idle-timeout=600" +# # Don't mount until first access +# "x-systemd.automount" - # Give the Pi/Tailscale a little time to appear - "x-systemd.device-timeout=10s" +# # Unmount after 10 min idle +# "x-systemd.idle-timeout=600" - # Explicitly use NFSv4.2 if supported - "nfsvers=4.2" - ]; -}; +# # Give the Pi/Tailscale a little time to appear +# "x-systemd.device-timeout=10s" + +# # Explicitly use NFSv4.2 if supported +# "nfsvers=4.2" +# ]; +# }; # Create nextcloud cron scheduled task systemd.services.nextcloud = { diff --git a/modules/raspi/mount-data.nix b/modules/raspi/mount-data.nix new file mode 100644 index 0000000..0461c53 --- /dev/null +++ b/modules/raspi/mount-data.nix @@ -0,0 +1,25 @@ +{ ... }: + +{ +fileSystems."/mnt/raspi" = { + device = "raspberrypi.tail13f623.ts.net:/home/raspi/raspi"; + fsType = "nfs4"; + options = [ + "nofail" + "_netdev" + "noatime" + + # Don't mount until first access + "x-systemd.automount" + + # Unmount after 10 min idle + "x-systemd.idle-timeout=600" + + # Give the Pi/Tailscale a little time to appear + "x-systemd.device-timeout=10s" + + # Explicitly use NFSv4.2 if supported + "nfsvers=4.2" + ]; +}; +} \ No newline at end of file