Fixup support for Nix 2.23.0 and later
This commit is contained in:
parent
b0723e0fae
commit
db4ee38117
4 changed files with 27 additions and 6 deletions
7
dist/index.js
vendored
7
dist/index.js
vendored
|
@ -95086,8 +95086,13 @@ function makeNixCommandArgs(nixOptions, flakeInputs, commitMessage) {
|
||||||
"--update-input",
|
"--update-input",
|
||||||
input
|
input
|
||||||
]);
|
]);
|
||||||
|
const lockfileSummaryFlags = [
|
||||||
|
"--option",
|
||||||
|
"commit-lockfile-summary",
|
||||||
|
commitMessage
|
||||||
|
];
|
||||||
const updateLockMechanism = flakeInputFlags.length === 0 ? "update" : "lock";
|
const updateLockMechanism = flakeInputFlags.length === 0 ? "update" : "lock";
|
||||||
return nixOptions.concat(["flake", updateLockMechanism]).concat(flakeInputFlags).concat(["--commit-lock-file", "--commit-lockfile-summary", commitMessage]);
|
return nixOptions.concat(["flake", updateLockMechanism]).concat(flakeInputFlags).concat(["--commit-lock-file"]).concat(lockfileSummaryFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
// src/index.ts
|
// src/index.ts
|
||||||
|
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -24,7 +24,8 @@ test("Nix command arguments", () => {
|
||||||
"flake",
|
"flake",
|
||||||
"update",
|
"update",
|
||||||
"--commit-lock-file",
|
"--commit-lock-file",
|
||||||
"--commit-lockfile-summary",
|
"--option",
|
||||||
|
"commit-lockfile-summary",
|
||||||
"just testing",
|
"just testing",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -42,7 +43,8 @@ test("Nix command arguments", () => {
|
||||||
"--update-input",
|
"--update-input",
|
||||||
"rust-overlay",
|
"rust-overlay",
|
||||||
"--commit-lock-file",
|
"--commit-lock-file",
|
||||||
"--commit-lockfile-summary",
|
"--option",
|
||||||
|
"commit-lockfile-summary",
|
||||||
"just testing",
|
"just testing",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -57,7 +59,8 @@ test("Nix command arguments", () => {
|
||||||
"flake",
|
"flake",
|
||||||
"update",
|
"update",
|
||||||
"--commit-lock-file",
|
"--commit-lock-file",
|
||||||
"--commit-lockfile-summary",
|
"--option",
|
||||||
|
"commit-lockfile-summary",
|
||||||
"just testing",
|
"just testing",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
15
src/nix.ts
15
src/nix.ts
|
@ -9,10 +9,23 @@ export function makeNixCommandArgs(
|
||||||
input,
|
input,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// NOTE(cole-h): In Nix versions 2.23.0 and later, `commit-lockfile-summary` became an alias to
|
||||||
|
// the setting `commit-lock-file-summary` (https://github.com/NixOS/nix/pull/10691), and Nix does
|
||||||
|
// not treat aliases the same as their "real" setting by requiring setting aliases to be
|
||||||
|
// configured via `--option <alias name> <option value>`
|
||||||
|
// (https://github.com/NixOS/nix/issues/10989).
|
||||||
|
// So, we go the long way so that we can support versions both before and after Nix 2.23.0.
|
||||||
|
const lockfileSummaryFlags = [
|
||||||
|
"--option",
|
||||||
|
"commit-lockfile-summary",
|
||||||
|
commitMessage,
|
||||||
|
];
|
||||||
|
|
||||||
const updateLockMechanism = flakeInputFlags.length === 0 ? "update" : "lock";
|
const updateLockMechanism = flakeInputFlags.length === 0 ? "update" : "lock";
|
||||||
|
|
||||||
return nixOptions
|
return nixOptions
|
||||||
.concat(["flake", updateLockMechanism])
|
.concat(["flake", updateLockMechanism])
|
||||||
.concat(flakeInputFlags)
|
.concat(flakeInputFlags)
|
||||||
.concat(["--commit-lock-file", "--commit-lockfile-summary", commitMessage]);
|
.concat(["--commit-lock-file"])
|
||||||
|
.concat(lockfileSummaryFlags);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue