diff --git a/flake.nix b/flake.nix index 1e5bbc2..8d446c8 100644 --- a/flake.nix +++ b/flake.nix @@ -139,6 +139,10 @@ set -e + fallocate -l 4G /swapfile + chmod 0600 /swapfile + mkswap /swapfile + echo "Creating two partitions" fdisk -w always /dev/nvme0n1 << EOL g @@ -169,8 +173,6 @@ btrfs subvolume create /btrfs/nvme/@var-lib-rancher btrfs subvolume create /btrfs/nvme/@var-log-pods - btrfs filesystem mkswapfile -s 4g /btrfs/nvme/@swap/file - umount /btrfs/nvme cryptsetup luksClose cryptdrive1 @@ -260,7 +262,7 @@ swapDevices = let swapFile = { - device = "/swap/file"; + device = "/swapfile"; size = (1024 * 4); }; in @@ -323,6 +325,10 @@ set -e + fallocate -l 4G /swapfile + chmod 0600 /swapfile + mkswap /swapfile + echo "YES" | cryptsetup luksFormat /dev/nvme0n1 -d ${keyFilePath} cryptsetup luksOpen /dev/nvme0n1 cryptdrive1 -d ${keyFilePath} @@ -339,8 +345,6 @@ btrfs subvolume create /btrfs/nvme/@var-lib-rancher btrfs subvolume create /btrfs/nvme/@var-log-pods - btrfs filesystem mkswapfile -s 4g /btrfs/nvme/@swap/file - umount /btrfs/nvme cryptsetup luksClose cryptdrive1 @@ -406,7 +410,7 @@ swapDevices = let swapFile = { - device = "/swap/file"; + device = "/swapfile"; size = (1024 * 4); }; in