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.
No, there isn’t. If you come up with something I’m sure the community would appreciate it though
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.
I also have need for this this workflow and this is the top google result. Based on @akiross’s original method, I use this pkg in my devshell scope, so I just nix-flake-update -e input-name