0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 06:00:33 +03:00

Turn fileSystems into an attribute set

So now you can write

  fileSystems =
    [ { mountPoint = "/";
        device = "/dev/sda1";
      }
    ];

as

  fileSystems."/".device = "/dev/sda1";
This commit is contained in:
Eelco Dolstra 2012-11-02 18:02:12 +01:00
parent 97f087cd44
commit 458f36f5f1
9 changed files with 131 additions and 148 deletions

View file

@ -320,35 +320,33 @@ in
# where the regular value for the `fileSystems' attribute should be
# disregarded for the purpose of building a VM test image (since
# those filesystems don't exist in the VM).
fileSystems = mkOverride 50 (
[ { mountPoint = "/";
device = "/dev/vda";
}
{ mountPoint = "/nix/store";
device = "//10.0.2.4/store";
fsType = "cifs";
options = "guest,sec=none,noperm,noacl";
neededForBoot = true;
}
{ mountPoint = "/tmp/xchg";
device = "//10.0.2.4/xchg";
fsType = "cifs";
options = "guest,sec=none,noperm,noacl";
neededForBoot = true;
}
{ mountPoint = "/tmp/shared";
device = "//10.0.2.4/shared";
fsType = "cifs";
options = "guest,sec=none,noperm,noacl";
neededForBoot = true;
}
] ++ optional cfg.useBootLoader
{ mountPoint = "/boot";
device = "/dev/disk/by-label/boot";
fsType = "ext4";
options = "ro";
noCheck = true; # fsck fails on a r/o filesystem
});
fileSystems =
{ "/".device = "/dev/vda";
"/nix/store" =
{ device = "//10.0.2.4/store";
fsType = "cifs";
options = "guest,sec=none,noperm,noacl";
};
"/tmp/xchg" =
{ device = "//10.0.2.4/xchg";
fsType = "cifs";
options = "guest,sec=none,noperm,noacl";
neededForBoot = true;
};
"/tmp/shared" =
{ device = "//10.0.2.4/shared";
fsType = "cifs";
options = "guest,sec=none,noperm,noacl";
neededForBoot = true;
};
} // optionalAttrs cfg.useBootLoader
{ "/boot" =
{ device = "/dev/disk/by-label/boot";
fsType = "ext4";
options = "ro";
noCheck = true; # fsck fails on a r/o filesystem
};
};
swapDevices = mkOverride 50 [ ];