NixOS/nixpkgs — pull request #1791 by wizeman (2014-02-19 16:41:05+00:00)
Title: Improve nixos-generate-config filesystem generation

This pull request includes 2 changes for nixos-generate-config:

* Don't generate /var/lib/nfs/rpc_pipefs filesystem. This is automatically mounted if the system has support for NFS, so there's no need to put it into /etc/nixos/hardware-configuration.nix.
* Don't generate filesystem options.

As for the latter, currently, nixos-generate-config generates mount options, which are taken from the current mounted filesystems and written into hardware-configuration.nix.

The problem is, most of these options are usually just defaults chosen by the kernel. So if you upgrade your kernel and the default mount options have changed (such as it happened in the past with "atime -> relatime", or ext4's "barrier=0 -> barrier=1"), you will keep using the old defaults (the ones corresponding to the kernel being used at the time hardware-configuration.nix was generated) instead of the new ones compiled into the current kernel.

Most likely the sysadmin doesn't care about most of these options (e.g. "relatime", "thread_pool=8" in btrfs, ...) and instead he just wants to use the best defaults for the current kernel, so I've changed the code not to generate the options (the only exceptions are "loop" for loop devices and "bind" for bind mounts, as they are required mount options).

After this change, if the sysadmin wants to mount some filesystem with a specific, non-default mount option, he should specify it in /etc/nixos/configuration.nix.