qrencode: isntall in office profile
[julm/julm-nix.git] / hosts / oignon.nix
index 58a7c27ee1472fdfc86ca90b285db14af10c96d9..713974c23dc0e1877331583d937fdec7cff2f23f 100644 (file)
 
   services.davfs2.enable = true;
 
+  systemd.automounts = [
+    { where = "/mnt/aubergine"; automountConfig.TimeoutIdleSec = "5 min"; }
+  ];
   fileSystems =
-    # Use the user's gpg-agent session to query
-    # for the password of the SSH key when auto-mounting.
     let
-      sshAsUser = user:
-        pkgs.writeScript "sshAsUser-${user}" ''
-          exec ${pkgs.sudo}/bin/sudo -i -u ${user} \
+      # Use the user's gpg-agent session to query
+      # for the password of the SSH key when auto-mounting.
+      sshAsUser =
+        pkgs.writeScript "sshAsUser" ''
+          user="$1"; shift
+          exec ${pkgs.sudo}/bin/sudo -i -u "$user" \
             ${pkgs.openssh}/bin/ssh "$@"
         '';
       options =
           "noatime"
           "nosuid"
           "_netdev"
-          "ssh_command=${sshAsUser "julm"}" #  "reconnect"
+          "ssh_command=${sshAsUser}\\040julm"
           "noauto"
           "x-gvfs-hide"
           "x-systemd.automount"
           # Disconnect approximately 2*15=30 seconds after a network failure
           "ServerAliveCountMax=1"
           "ServerAliveInterval=15"
+          "dir_cache=no"
+          #"reconnect"
         ];
     in
     {