disko: cleanup code

Thanks @marenz :)
This commit is contained in:
Sandro - 2023-05-20 04:18:29 +02:00
parent 7516e0a906
commit a5235a4654
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
1 changed files with 3 additions and 19 deletions

View File

@ -123,25 +123,9 @@ in
} // lib.optionalAttrs disk.withLuks {
lvm_vg.${vgName} = {
type = "lvm_vg";
lvs = lib.optionalAttrs disk.withCeph
{
# TODO: delete old code if this works
ceph.size = "100%FREE";
# the header is 3650 byte long and substract an additional 446 byte for aligment
# error messages:
# Volume group "lvm-chaos" has insufficient free space (51195 extents): 51200 required.
# Size is not a multiple of 512. Try using 40057405440 or 40057405952.
# ceph.size =
# let
# # convert GiB to bytes
# rootSizeMiB = rootSize * 1024 * 1024 * 1024;
# # convert back to MiB and allign to 4 MiB in the process
# roundToMiB = "/1024/1024/4*4";
# # substract 512 MiB for /boot and 20 MiB for luks+header+other
# bootOther = "-512-20";
# in
# "$((($(lsblk ${disk.device} --noheadings --nodeps --output SIZE --bytes)-${toString rootSizeMiB})${roundToMiB}${bootOther}))MiB";
} // lib.optionalAttrs disk.withZfs { inherit zfs; };
lvs = lib.optionalAttrs disk.withCeph {
ceph.size = "100%FREE";
} // lib.optionalAttrs disk.withZfs { inherit zfs; };
};
} // {
zpool.${zfsName} = {