I have several flakes, let’s say A, B, C which have dependencies C->B->A.
Their inputs urls point to their github repos normally but when I develop I want to vendor all dependencies locally.
I’ve tried using --override-input but it only overrides inputs on the most immediate flake. For example I don’t know how to override A when building C.
I’d like to be able override inputs regardless how deep in the hierarchy they lie.
Is there a way how to do that other than writing a custom script to do all the overrides inside flake.lock for me?
I think you can do this, and if you nix flake lock --override-input A ../A, it will build C with B with local A. You could add a separate “localB” input, and add separate outputs using it if you don’t want to change it each time you are developing locally.
follows and input overriding in inputs definition both have their places (and inputs.B.inputs.A.follows = "A"; is an example of both) but they are probably not what I’m looking for.
In your example you add
inputs.A.url = "..."; which is really is superfluous
inputs.B.inputs.A.follows = "A"; which may or may not be necessary/proper/correct from a design standpoint.
and it brings possibly unnecessary knowledge of B dependencies into C. This gets convoluted very fast in my opinion and in my limited experience.
I think I just really want something like --override-input-recursively
Here is my real world example: I have cadquery/flake.nix at 5a389bb738b5da86f7646a7292bedb1786730430 · Grawp/cadquery · GitHub and let’s suppose I change something in pywrap which is ocp's dependency and I want to try it but I do not want cadquery to know that its ocp dependency has pywrap dependency!
I do not want to flatten the dependency tree into some list. I just want to override all pywrap nodes in the tree for one time experiment.
I grepped for the error I got, and checked in the Nix source, and saw that it parses it with a / to figure this out. Now I just checked the man page / nix flake lock --help, and see that it has an example with the path “dwarffs/nixpkgs”, and realized I had read that before but not realized what it meant.