mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
Add flags to disallow dirty Git trees and to turn off warnings
This commit is contained in:
parent
99e8e58f2d
commit
68e0f23edc
4 changed files with 21 additions and 6 deletions
|
@ -480,9 +480,10 @@ ResolvedFlake resolveFlake(EvalState & state, const FlakeRef & topRef, HandleLoc
|
|||
if (!(lockFile == oldLockFile)) {
|
||||
if (allowedToWrite(handleLockFile)) {
|
||||
if (auto refData = std::get_if<FlakeRef::IsPath>(&topRef.data)) {
|
||||
if (lockFile.isDirty())
|
||||
warn("will not write lock file of flake '%s' because it has a dirty input", topRef);
|
||||
else {
|
||||
if (lockFile.isDirty()) {
|
||||
if (evalSettings.warnDirty)
|
||||
warn("will not write lock file of flake '%s' because it has a dirty input", topRef);
|
||||
} else {
|
||||
lockFile.write(refData->path + (topRef.subdir == "" ? "" : "/" + topRef.subdir) + "/flake.lock");
|
||||
|
||||
// Hack: Make sure that flake.lock is visible to Git, so it ends up in the Nix store.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue