From bc4e159d0e78cef78a5b12cb9ea21a3df3593272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Mon, 22 Feb 2010 21:41:49 +0000 Subject: [PATCH] Fixing a terrible bug in nixos nfs-kernel server, related to the exports file. The file contents were taken as a file path. This resulted in a system with a totally broken /etc: lrwxrwxrwx 1 root nixbld 51 22 feb 21:45 bashrc -> /nix/store/gh71a6w50cxrl4124kxfn24yi0b7aaka-useradd lrwxrwxrwx 1 root nixbld 44 22 feb 21:45 nix.conf -> 192.168.1.4(rw,no_root_squash,no_all_squash) lrwxrwxrwx 1 root nixbld 58 22 feb 21:45 inputrc -> /nix/store/1czhdj7q74dc556frqrh51jyshfsxhl3-bashrc-user.sh lrwxrwxrwx 1 root nixbld 51 22 feb 21:45 nsswitch.conf -> /nix/store/qsgsli992hd1g8245d8am9izn9xmw90x-inputrc lrwxrwxrwx 1 root nixbld 20 22 feb 21:45 exports -> /home/sheevaplugroot Notice that the inputrc has strange contents. In my case, that disabled me to type 's' or 'i' (at least) in any new interactive shell. If you notice, the 'exports' symlink should point to a store file, which contents had to look like: /home/sheevaplugroot 192.168.1.4(rw,no_root_squash,no_all_squash) This patch achieves this later behaviour rather than the former. svn path=/nixos/trunk/; revision=20181 --- modules/services/network-filesystems/nfs-kernel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/network-filesystems/nfs-kernel.nix b/modules/services/network-filesystems/nfs-kernel.nix index 8b2d6158443d..24817c6178bc 100644 --- a/modules/services/network-filesystems/nfs-kernel.nix +++ b/modules/services/network-filesystems/nfs-kernel.nix @@ -82,7 +82,7 @@ in }); environment.etc = mkIf cfg.server.enable (singleton - { source = cfg.server.exports; + { source = pkgs.writeText "exports" cfg.server.exports; target = "exports"; });