builders: do not mount / and /boot on netboot systems

This commit is contained in:
Yureka 2024-08-03 18:41:01 +02:00
parent f7907a2915
commit 830dcbf6bc

View file

@ -55,29 +55,34 @@ in
boot.initrd.services.lvm.enable = true; boot.initrd.services.lvm.enable = true;
fileSystems."/" = {
device = "/dev/disk/by-label/root";
fsType = "xfs";
};
fileSystems."/mnt" = {
device = "/dev/disk/by-label/hydra";
fsType = "xfs";
options = ["logbsize=256k"];
};
boot.kernel.sysctl."fs.xfs.xfssyncd_centisecs" = "12000"; boot.kernel.sysctl."fs.xfs.xfssyncd_centisecs" = "12000";
fileSystems = lib.mkMerge [
{
"/" = {
device = "/dev/disk/by-label/root";
fsType = "xfs";
};
# We want the tmp filesystem on the same filesystem as the hydra store, so that builds can use reflinks "/boot" = {
fileSystems."/tmp" = { device = "/dev/disk/by-label/BOOT";
device = "/mnt/tmp"; fsType = "vfat";
options = [ "bind" ]; options = [ "fmask=0022" "dmask=0022" ];
}; };
}
(lib.mkIf (!cfg.netboot) {
"/mnt" = {
device = "/dev/disk/by-label/hydra";
fsType = "xfs";
options = ["logbsize=256k"];
};
fileSystems."/boot" = { # We want the tmp filesystem on the same filesystem as the hydra store, so that builds can use reflinks
device = "/dev/disk/by-label/BOOT"; "/tmp" = {
fsType = "vfat"; device = "/mnt/tmp";
options = [ "fmask=0022" "dmask=0022" ]; options = [ "bind" ];
}; };
})
];
swapDevices = lib.optionals (!cfg.netboot) [ swapDevices = lib.optionals (!cfg.netboot) [
{ {