mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 01:38:06 +00:00
[FileSystems] Fix some bugs happening if swap label does not exist
This commit is contained in:
parent
a481ab4da6
commit
da9d521545
1 changed files with 3 additions and 2 deletions
|
|
@ -4,7 +4,8 @@ let
|
||||||
cfg = config.aviallon.filesystems;
|
cfg = config.aviallon.filesystems;
|
||||||
|
|
||||||
getSwapDevice = index: ifEnable (length config.swapDevices > index) (elemAt config.swapDevices index);
|
getSwapDevice = index: ifEnable (length config.swapDevices > index) (elemAt config.swapDevices index);
|
||||||
resumeDevice = ifEnable ((getSwapDevice 0) ? label ) ((getSwapDevice 0).label);
|
firstSwapDevice = getSwapDevice 0;
|
||||||
|
resumeDeviceLabel = attrByPath [ "label" ] null firstSwapDevice;
|
||||||
|
|
||||||
ioSchedType = types.enum [ "bfq" "kyber" "mq-deadline" "none" null ];
|
ioSchedType = types.enum [ "bfq" "kyber" "mq-deadline" "none" null ];
|
||||||
in
|
in
|
||||||
|
|
@ -60,7 +61,7 @@ in
|
||||||
];
|
];
|
||||||
boot.kernelModules = ifEnable cfg.lvm [ "dm-cache" "dm-cache-smq" "dm-persistent-data" "dm-bio-prison" "dm-clone" "dm-crypt" "dm-writecache" "dm-mirror" "dm-snapshot"];
|
boot.kernelModules = ifEnable cfg.lvm [ "dm-cache" "dm-cache-smq" "dm-persistent-data" "dm-bio-prison" "dm-clone" "dm-crypt" "dm-writecache" "dm-mirror" "dm-snapshot"];
|
||||||
aviallon.boot.cmdline = {
|
aviallon.boot.cmdline = {
|
||||||
resume = mkIf (! isNull resumeDevice) (mkDefault "LABEL=${resumeDevice}");
|
resume = mkIf (! isNull resumeDeviceLabel) (mkDefault "LABEL=${resumeDeviceLabel}");
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot".neededForBoot = mkDefault true;
|
fileSystems."/boot".neededForBoot = mkDefault true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue