Is there a flake equivalent to niv update <name-of-single-source>?
Running nix flake update --help suggests no to me and I can’t find anything in online searches either.
I guess I can run nix flake update to update all flakes then revert lockfile changes for inputs I want to keep the same, but I was wondering if a better way exists.
You can update individual inputs using nix flake lock, an example from its help:
• Update the nixpkgs and nix inputs of the flake in the current directory:
# nix flake lock --update-input nixpkgs --update-input nix
* Updated 'nix': 'github:NixOS/nix/9fab14adbc3810d5cc1f88672fde1eee4358405c' -> 'github:NixOS/nix/8927cba62f5afb33b01016d5c4f7f8b7d0adde3c'
* Updated 'nixpkgs': 'github:NixOS/nixpkgs/3d2d8f281a27d466fa54b469b5993f7dde198375' -> 'github:NixOS/nixpkgs/a3a3dda3bacf61e8a39258a0ed9c924eeca8e293'
As you can see my purebred input and its inputs are updated. So far that is what I expected. But then some inputs of my nvimpager input also gets updated and I don’t want that.
If I also specify --no-update-lock-file it obviously fails with
error: flake 'git+file:///home/luc/src/sys' requires lock file changes but they're not allowed due to '--no-update-lock-file'
For reference my flake is here:
Do you know if this is to be expected our how I can update only one of my inputs (and maybe its inputs with it)?
While I don’t know for sure, I imagine the problem is the follows. Since you’re asking purebred to use the same inputs as your other inputs, those must in turn also be updated if you update purebred.
I’m a bit confused though, the flake on your repo doesn’t have an input named nvimpager, so it’s hard to tell what’s going on.
Sorry I had not pushed the correct code and my local git history is in a mess because I tried to rewrite some stuff.
I have now pushed a tests branch and the commit 8599d4ac3c9937e3f38b674b0b58801883e6ab15 shows the behaviour I describe above (some hashes differ by now but nvimpager stuff is updated even though I only request to update purebread).
Maybe the following is related: If I am on the mentioned commit 8599d4ac3c9937e3f38b674b0b58801883e6ab15 and execute nix flake metadata it also tries to modify my lock file:
That was very astonishing to me because I assumed nix flake metadata to be purely inquiring.
It might be that the commit 364a3fd299e91b4b72d0b6e852f6ca7bd5154e8f is at fault where I removed inputs.purebred.inputs.nixpkgs.follows = "nixpkgs"; from my flake.nix but did not update the lock file accordingly.