mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-24 23:06:16 +02:00
nix registry pin: Warn if the resolved flake is not locked
This commit is contained in:
parent
184c6605b0
commit
a3427a1478
1 changed files with 2 additions and 0 deletions
|
@ -189,6 +189,8 @@ struct CmdRegistryPin : RegistryCommand, EvalCommand
|
||||||
auto lockedRef = parseFlakeRef(locked);
|
auto lockedRef = parseFlakeRef(locked);
|
||||||
registry->remove(ref.input);
|
registry->remove(ref.input);
|
||||||
auto [accessor, resolved] = lockedRef.resolve(store).input.lazyFetch(store);
|
auto [accessor, resolved] = lockedRef.resolve(store).input.lazyFetch(store);
|
||||||
|
if (!resolved.isLocked())
|
||||||
|
warn("flake '%s' is not locked", resolved.to_string());
|
||||||
fetchers::Attrs extraAttrs;
|
fetchers::Attrs extraAttrs;
|
||||||
if (ref.subdir != "") extraAttrs["dir"] = ref.subdir;
|
if (ref.subdir != "") extraAttrs["dir"] = ref.subdir;
|
||||||
registry->add(ref.input, resolved, extraAttrs);
|
registry->add(ref.input, resolved, extraAttrs);
|
||||||
|
|
Loading…
Reference in a new issue