From 0f9576cedc9b23ec8b01302daae919bc6018c3ca Mon Sep 17 00:00:00 2001 From: Alex James Date: Tue, 3 Dec 2024 22:53:36 -0600 Subject: [PATCH] nix: fix Lix version detection in auto-optimise-store assertion --- modules/nix/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nix/default.nix b/modules/nix/default.nix index 09e6e50d..41398fac 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -763,8 +763,8 @@ in { # Should be fixed in Lix by https://gerrit.lix.systems/c/lix/+/2100 - # As `isNixAtLeast "2.92.0" "2.92.0-devpre20241107" == false`, we need to explicitly check if the user is running Lix 2.92.0 - assertion = cfg.settings.auto-optimise-store -> (cfg.package.pname == "lix" && (isNixAtLeast "2.92.0-devpre20241107" || cfg.package.version == "2.92.0")); + # Lix 2.92.0 will set `VERSION_SUFFIX` to `""`; `lib.versionAtLeast "" "pre20241107"` will return `true`. + assertion = cfg.settings.auto-optimise-store -> (cfg.package.pname == "lix" && (isNixAtLeast "2.92.0" && versionAtLeast (strings.removePrefix "-" cfg.package.VERSION_SUFFIX) "pre20241107")); message = "`nix.settings.auto-optimise-store` is known to corrupt the Nix Store, please use `nix.optimise.automatic` instead."; } ];