diff --git a/example/luks-lvm.nix b/example/luks-lvm.nix index 768451bf..1bede949 100644 --- a/example/luks-lvm.nix +++ b/example/luks-lvm.nix @@ -45,7 +45,7 @@ type = "lvm_vg"; lvs = { root = { - size = "100M"; + size = "100%"; content = { type = "filesystem"; format = "ext4"; diff --git a/lib/types/lvm_vg.nix b/lib/types/lvm_vg.nix index 9ae6a532..708e88b2 100644 --- a/lib/types/lvm_vg.nix +++ b/lib/types/lvm_vg.nix @@ -95,7 +95,7 @@ in --yes \ ${if (lv.lvm_type == "thinlv") then "-V" else if lib.hasInfix "%" lv.size then "-l" else "-L"} \ - ${lv.size} \ + ${if lib.hasSuffix "%" lv.size then "${lv.size}FREE" else lv.size} \ -n "${lv.name}" \ ${lib.optionalString (lv.lvm_type == "thinlv") "--thinpool=${lv.pool}"} \ ${lib.optionalString (lv.lvm_type != null && lv.lvm_type != "thinlv") "--type=${lv.lvm_type}"} \