`nix flake lock` how to exclude input from update

Hello,

I would like to update all the inputs but a few in a flake.lock.
This would be used in an automatic pipeline in which some inputs are known, but not the others. Some of the known inputs must not be locked, all the others should be locked.

My current solution would be to extract all the flake inputs (e.g. using nix flake info --json | jq ".locks.nodes.root.inputs | keys") and exclude the ones I don’t want to update (e.g. | map(select(. != "nixpkgs"))) - passing what’s left to nix flake lock --update-input x --update-input y ...

Is there a leaner alternative?
I’m a bit bummed by --update-input not having a --no-update-input (exclude) counterpart.

Thank you!

No, there isn’t. If you come up with something I’m sure the community would appreciate it though :slight_smile:

But as far as your usecase, if you need to pin some inputs, specifying the commit hash explicitly in the flake inputs would prevent them from getting bumped.

1 Like