Skip to content

Commit

Permalink
Merge pull request #1211 from al3xtjames/nix-lix-version-check
Browse files Browse the repository at this point in the history
nix: fix Lix version detection in auto-optimise-store assertion
  • Loading branch information
Enzime authored Dec 4, 2024
2 parents c6b65d9 + 0f9576c commit e7a71f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
}
];
Expand Down

0 comments on commit e7a71f8

Please sign in to comment.