diff --git a/nix/os/devices/disk.nix b/nix/os/devices/disk.nix index 4181f1a..ad9bb52 100644 --- a/nix/os/devices/disk.nix +++ b/nix/os/devices/disk.nix @@ -113,7 +113,7 @@ in rec { # LVM sudo vgcreate ${ownLib.disk.volumeGroup diskId} ${ownLib.disk.lvmPv diskId encrypted} - sudo lvcreate ${ownLib.disk.volumeGroup diskId} -L 2G -n swap + sudo lvcreate ${ownLib.disk.volumeGroup diskId} -L 16G -n swap sudo lvcreate ${ownLib.disk.volumeGroup diskId} -l 100%FREE -n root # Filesystem diff --git a/nix/os/lib/default.nix b/nix/os/lib/default.nix index 503d30e..0ea00d4 100644 --- a/nix/os/lib/default.nix +++ b/nix/os/lib/default.nix @@ -32,8 +32,9 @@ shortenGptPartlabel = partlabel: (builtins.substring 0 36 partlabel); # LVM doesn't allow most characters in VG names + # Maximum length for VGs and LVs is 128, therefore the VG name must adhere to VG <= 128-LV. # TODO: replace this with a whitelist for: [a-zA-Z0-9.-_+] - volumeGroup = diskId: builtins.replaceStrings [ ":" ] [ "" ] diskId; + volumeGroup = diskId: (builtins.substring 0 120 (builtins.replaceStrings [ ":" ] [ "" ] diskId)); # This is important at install-time bootGrubDevice = diskId: "/dev/disk/by-id/" + diskId;