The autocreate attribute in the fileSystems section of configuration.nix does not always cause mount points to be created via mkdir -p . This is because in modules/tasks/filesystems.nix the toString mapping converts false into the empty string, and then when the list is cast to a string, the empty strings just vanish, leaving a string in the bash file with too few entries.

Here is one way of correcting this:

[root@eka:/etc/nixos/nixos]# svn diff modules/tasks/filesystems.nix
Index: modules/tasks/filesystems.nix
===================================================================
— modules/tasks/filesystems.nix (revision 17869)
+++ modules/tasks/filesystems.nix (working copy)
@@ -9,7 +9,7 @@
devices = map (fs: if fs.device != null then fs.device else “/dev/disk/by-label/${fs.label}”) fileSystems;
fsTypes = map (fs: fs.fsType) fileSystems;
optionss = map (fs: fs.options) fileSystems;
- autocreates = map (fs: fs.autocreate) fileSystems;
+ autocreates = map (fs: if fs.autocreate then “1” else “0”) fileSystems;
mount = config.system.sbin.mount;

task =
Submitted on 22 October 2009 at 05:47

Log in to post comments