summary refs log tree commit diff
path: root/nixos/modules/tasks/filesystems.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2015-09-21 14:34:29 +0200
committeraszlig <aszlig@redmoonstudios.org>2015-09-21 22:32:14 +0200
commitcd4caed35ae8caf4473b2ac80d826f06e6a2e9e9 (patch)
treebf6b4a1fd156559d8108e902a319c311494095b7 /nixos/modules/tasks/filesystems.nix
parent74209a4ca8baedb7bf1b3e3720a9abf132f8c05e (diff)
downloadnixlib-cd4caed35ae8caf4473b2ac80d826f06e6a2e9e9.tar
nixlib-cd4caed35ae8caf4473b2ac80d826f06e6a2e9e9.tar.gz
nixlib-cd4caed35ae8caf4473b2ac80d826f06e6a2e9e9.tar.bz2
nixlib-cd4caed35ae8caf4473b2ac80d826f06e6a2e9e9.tar.lz
nixlib-cd4caed35ae8caf4473b2ac80d826f06e6a2e9e9.tar.xz
nixlib-cd4caed35ae8caf4473b2ac80d826f06e6a2e9e9.tar.zst
nixlib-cd4caed35ae8caf4473b2ac80d826f06e6a2e9e9.zip
nixos/filesystems: Improve vboxsf default options.
The default options for all file systems currently are
"defaults.relatime", which works well on file systems which support the
relatime option.

Unfortunately, this is not the case for the VirtualBox shared folder
filesystem, so until now, you need to set something like:

fileSystems."/foo" = {
  device = "foo";
  fsType = "vboxsf";
  options = "defaults";
};

Otherwise mounting the file system would fail.

Now, we provide only the "defaults" option to the "vboxsf" file system,
so something like this is enough:

fileSystems."/foo" = {
  device = "foo";
  fsType = "vboxsf";
};

An alternative to that could be to document that you need to set default
options, but we really should do what users expect instead of forcing
them to look up the documentation as to why this has failed.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'nixos/modules/tasks/filesystems.nix')
-rw-r--r--nixos/modules/tasks/filesystems.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix
index ce9e3555b6cd..cf6abf52cf65 100644
--- a/nixos/modules/tasks/filesystems.nix
+++ b/nixos/modules/tasks/filesystems.nix
@@ -69,6 +69,8 @@ let
     config = {
       mountPoint = mkDefault name;
       device = mkIf (config.fsType == "tmpfs") (mkDefault config.fsType);
+      # The vboxsf filesystem doesn't support the relatime option:
+      options = mkIf (config.fsType == "vboxsf") (mkDefault "defaults");
     };
 
   };