From fa066d486c2414c267b24790faab806f915249eb Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 22 Jun 2024 20:01:17 +0200 Subject: [PATCH] Add support for swap --- lib/modules/partition.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/modules/partition.nix b/lib/modules/partition.nix index 16c0e246..0fc88601 100644 --- a/lib/modules/partition.nix +++ b/lib/modules/partition.nix @@ -7,6 +7,7 @@ fs = { ext4 = "ext4"; + swap = "swap"; ntfs = "ntfs"; fat32 = "fat32"; }; @@ -99,12 +100,14 @@ formatScripts = { ${fs.ext4} = "mkfs.ext4 -F ${diskVar}"; + ${fs.swap} = "mkswap ${diskVar}"; ${fs.ntfs} = "mkfs.ntfs -F ${diskVar}"; ${fs.fat32} = "mkfs.fat -F 32 ${diskVar}"; }; labelScripts = { ${fs.ext4} = label: "e2label ${diskVar} ${label}"; + ${fs.swap} = label: "swaplabel ${diskVar} ${label}"; ${fs.ntfs} = label: "ntfslabel ${diskVar} ${label}"; ${fs.fat32} = label: "fatlabel ${diskVar} ${label}"; };