[Filesystems] remove automatic resume device setup

This commit is contained in:
Antoine Viallon 2023-08-10 16:29:56 +02:00
parent 883e4585b2
commit d4234b7371
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -3,10 +3,6 @@ with lib;
let
cfg = config.aviallon.filesystems;
getSwapDevice = index: ifEnable (length config.swapDevices > index) (elemAt config.swapDevices index);
firstSwapDevice = getSwapDevice 0;
resumeDeviceLabel = attrByPath [ "label" ] null firstSwapDevice;
ioSchedType = types.enum [ "bfq" "kyber" "mq-deadline" "none" null ];
in
{
@ -52,6 +48,12 @@ in
type = types.listOf types.str;
};
lvm = mkEnableOption "lvm options required for correct booting";
resumeDevice = mkOption {
default = null;
description = "Swap device used for hibernation/resuming.";
example = "LABEL=nixos-swap";
type = types.nullOr types.str;
};
};
config = mkIf cfg.enable {
@ -70,7 +72,11 @@ in
;
aviallon.boot.cmdline = {
resume = mkIf (! isNull resumeDeviceLabel) (mkDefault "LABEL=${resumeDeviceLabel}");
resume =
if isNull cfg.resumeDevice
then "none"
else cfg.resumeDevice
;
};