When the root filesystem is the first element in the config.fileSystems array, the other filesystems do not get mounted. This is because in the generated bash script the root filesystem will be first. The test to see if the root filesystem is mounted will return true, because in all cases when this bash script runs the root filesystem will be mounted. Thus the “remount” branch of the code will be taken which leads to the evaluation of a continue. At this point the flag the while loop is using to decide whether to reloop has not been set. Thus the while loop will be executed only once and in that execution will only remount the root filesystem.

The issue can be reproduced with this configuration.nix, which mount the root filesystem (label nixos) via the remount branch and does not autocreate or mount the second filesystem (label storage) :

# /etc/nixos/configuration.nix
{pkgs, config, …}:

{
boot.initrd.extraKernelModules = [ “sata_via” “pata_via” “uhci_hcd” “ehci_hcd” “usb_storage” “ext4” ];
boot.kernelModules = [ “kvm-amd” ];
boot.kernelPackages = pkgs.kernelPackages_2_6_29;
boot.loader.grub.device = “/dev/sda”;

fileSystems = [
{ mountPoint = “/”;
label = “nixos”;
fsType = “ext4”;
options = “acl,user_xattr,usrquota,grpquota”;
}
{ mountPoint = “/srv/storage”;
label = “storage”;
fsType = “ext4”;
autocreate = true;
options = “acl,user_xattr,usrquota,grpquota”;
}
];

i18n = {
defaultLocale = “en_US.UTF-8”;
consoleKeyMap = “es”;
};

networking.hostName = “eka”;

nix.maxJobs = 1;

services = {
sshd = {
enable = true;
};
xserver = {
enable = true;
layout = “es”;
xkbModel = “pc105”;
videoDriver = “ati”;
displayManager.slim.enable = false;
displayManager.kdm.enable = true;
desktopManager.default = “kde4”;
desktopManager.kde4.enable = true;
};
};

swapDevices = [
{ label = “swap”; }
];

time = {
timeZone = “America/Caracas”;
};

users = {
extraUsers = [
{ name = “kkallio”;
uid = 1000;
description = “Karn Kallio”;
home = “/home/kkallio”;
createHome = true;
group = “kkallio”;
extraGroups = [ “users” “wheel” ];
useDefaultShell = true;
}
];

 extraGroups = [
   { name = "kkallio";
     gid = 1000;
   }
 ];

};
}

Submitted on 27 October 2009 at 02:27

Log in to post comments