Skip to content

Commit 6fa35d4

Browse files
committed
update-diff: guard --force-correctness behind dix version check
The --force-correctness flag was only introduced in dix 1.4.2. Users pinning older nixpkgs stable releases ship an earlier dix that rejects the unknown flag, breaking the activation-time diff. Check the package version and omit the flag when dix is too old so the module keeps working across nixpkgs channels.
1 parent f54ed79 commit 6fa35d4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

shared/common/update-diff.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
};
1313
command = lib.mkOption {
1414
type = lib.types.singleLineStr;
15-
default = "${lib.getExe pkgs.dix} --force-correctness";
15+
# --force-correctness was added in dix 1.4.2
16+
default =
17+
if lib.versionAtLeast (pkgs.dix.version or "0") "1.4.2" then
18+
"${lib.getExe pkgs.dix} --force-correctness"
19+
else
20+
"${lib.getExe pkgs.dix}";
1621
defaultText = lib.literalExpression ''"''${lib.getExe pkgs.dix} --force-correctness"'';
1722
description = "diff command";
1823
};

0 commit comments

Comments
 (0)