From a5235a465451a5a30a03e07f9275e135ebb94b72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 20 May 2023 04:18:29 +0200 Subject: [PATCH] disko: cleanup code Thanks @marenz :) --- modules/disko.nix | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/modules/disko.nix b/modules/disko.nix index 6501dcf1..50e5bb60 100644 --- a/modules/disko.nix +++ b/modules/disko.nix @@ -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} = {