Samba: Difference between revisions

No edit summary
JLC (talk | contribs)
CIFS mount configuration: - Added "nofail" to template config with explanation as to why
 
Line 349: Line 349:
=== CIFS mount configuration ===
=== CIFS mount configuration ===


The following snippets shows how to mount a CIFS (Windows) share in NixOS.
The following snippets shows how to mount a CIFS (Windows) share in NixOS.  
 
Note the inclusion of the <code>"nofail"</code> option; NixOS will treat CIFS shares like any other mounted drive, and this will allow the system to boot correctly if the mounted NAS is off or if the network is slow to initialize.
 
Replace all <code><FIELDS></code> with concrete values:
Replace all <code><FIELDS></code> with concrete values:


Line 363: Line 366:
       automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
       automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";


     in ["${automount_opts},credentials=/etc/nixos/smb-secrets"];
     in ["${automount_opts},credentials=/etc/nixos/smb-secrets" "nofail"];
   };
   };
}
}