mirror of
https://github.com/NixOS/nix
synced 2025-06-27 12:41:15 +02:00
Enforce use of immutable flakes in pure mode
... plus a temporary hack to allow impure flakes at top-level for the default installation source.
This commit is contained in:
parent
ba05f29838
commit
272b58220d
6 changed files with 46 additions and 19 deletions
|
@ -136,4 +136,18 @@ std::string FlakeRef::to_string() const
|
|||
else abort();
|
||||
}
|
||||
|
||||
bool FlakeRef::isImmutable() const
|
||||
{
|
||||
if (auto refData = std::get_if<FlakeRef::IsFlakeId>(&data))
|
||||
return (bool) refData->rev;
|
||||
|
||||
else if (auto refData = std::get_if<FlakeRef::IsGitHub>(&data))
|
||||
return (bool) refData->rev;
|
||||
|
||||
else if (auto refData = std::get_if<FlakeRef::IsGit>(&data))
|
||||
return (bool) refData->rev;
|
||||
|
||||
else abort();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue