From a3427a1478bed689d59f443478aa082b11f5482a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 25 Jul 2022 15:48:16 +0200 Subject: [PATCH] nix registry pin: Warn if the resolved flake is not locked --- src/nix/registry.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nix/registry.cc b/src/nix/registry.cc index 39d9702a0..44eaf89bc 100644 --- a/src/nix/registry.cc +++ b/src/nix/registry.cc @@ -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);