nix registry pin: Warn if the resolved flake is not locked

This commit is contained in:
Eelco Dolstra 2022-07-25 15:48:16 +02:00
parent 184c6605b0
commit a3427a1478

View file

@ -189,6 +189,8 @@ struct CmdRegistryPin : RegistryCommand, EvalCommand
auto lockedRef = parseFlakeRef(locked);
registry->remove(ref.input);
auto [accessor, resolved] = lockedRef.resolve(store).input.lazyFetch(store);
if (!resolved.isLocked())
warn("flake '%s' is not locked", resolved.to_string());
fetchers::Attrs extraAttrs;
if (ref.subdir != "") extraAttrs["dir"] = ref.subdir;
registry->add(ref.input, resolved, extraAttrs);