整理swap

This commit is contained in:
陈浩南 2023-07-09 22:51:56 +08:00
parent 53c94c46ee
commit 2377533a96
3 changed files with 3 additions and 1 deletions

View File

@ -141,6 +141,7 @@
};
mdadm =
"ARRAY /dev/md/swap metadata=1.2 name=chn-PC:swap UUID=2b546b8d:e38007c8:02990dd1:df9e23a4";
swap = [ "/dev/mapper/swap" ];
};
};}
)

View File

@ -19,7 +19,6 @@ inputs:
# sudo $(dirname $(realpath $(which systemctl)))/../lib/systemd/systemd-cryptsetup \
# attach swap /dev/md/swap - fido2-device=auto
# sudo mkswap --uuid clear /dev/mapper/swap
swapDevices = [ { device = "/dev/mapper/swap"; } ];
# kernel, modules, ucode
boot.kernelPackages = inputs.pkgs.linuxPackages_xanmod_latest;

View File

@ -12,6 +12,7 @@ inputs:
decrypt.auto = mkOption { type = types.attrsOf (types.submodule { options =
{ mapper = mkOption { type = types.nonEmptyStr; }; ssd = mkOption { type = types.bool; }; }; }); };
mdadm = mkOption { type = types.nullOr types.str; };
swap = mkOption { type = types.listOf types.nonEmptyStr; };
# swap and resume
# swap != resume.device if swap is a file
@ -52,6 +53,7 @@ inputs:
)
(inputs.localLib.attrsToList inputs.config.nixos.fileSystems.mount.btrfs)))
);
swapDevices = builtins.map (device: { device = device; }) inputs.config.nixos.fileSystems.swap;
boot.initrd =
{
luks.devices =