mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[Filesystems] remove automatic resume device setup
This commit is contained in:
parent
883e4585b2
commit
d4234b7371
1 changed files with 11 additions and 5 deletions
|
|
@ -3,10 +3,6 @@ with lib;
|
||||||
let
|
let
|
||||||
cfg = config.aviallon.filesystems;
|
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 ];
|
ioSchedType = types.enum [ "bfq" "kyber" "mq-deadline" "none" null ];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
@ -52,6 +48,12 @@ in
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
};
|
};
|
||||||
lvm = mkEnableOption "lvm options required for correct booting";
|
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 {
|
config = mkIf cfg.enable {
|
||||||
|
|
@ -70,7 +72,11 @@ in
|
||||||
;
|
;
|
||||||
|
|
||||||
aviallon.boot.cmdline = {
|
aviallon.boot.cmdline = {
|
||||||
resume = mkIf (! isNull resumeDeviceLabel) (mkDefault "LABEL=${resumeDeviceLabel}");
|
resume =
|
||||||
|
if isNull cfg.resumeDevice
|
||||||
|
then "none"
|
||||||
|
else cfg.resumeDevice
|
||||||
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue