Hello all, I am new to nix and am trying to setup a distribution and build environment using nix.
I am trying to achieve the following build hierarchy:
BASE
|
Foo (Uses Base as an Input)
|
Bar (Uses Foo as an Input)
There are different refs of base added to my private registry.
for ex:
flake:base/0.1.0
flake:base/0.2.0
I need to be able to rebuild the entire stack based on this base package and I was expecting to use the --override-input option in nix to achieve this. Following is a very simplified example of what I am trying to achieve. I have only included very sparse flake files in the interest of brevity.
I think your example are a bit off, as your bar does not reference foo, like it should according to your concept diagram above. Yet it references itself…
I should also warn you, more complex setups involving transitive dependencies and/or follows still have a number of outstanding bugs last time I checked. You may want to check the nix issues on github.
@NobbZ , yes i did think about doing that however, I wanted something less explicit. I will have many dependencies and dont want to have to do dep1.inputs.base.follows = base for all dependencies in a flake.
Hmm…did not think about overriding the registry. Now that you mention it, it might solve the issue.
Would I override flake as follows?
I think under certain circumstances, some patterns make sense?
I agree that explicit is better but in this case, explicit brings along a tonne of redundant boilerplate. I would have to override the inputs of each of my dependency in each flake file. Additionally, this assumes the person writing the flake file will have knowledge of the inputs of each of the flakes.
I want to basically consolidate this, instead of having lines upon lines of dep1.inputs.base = base just override this at one location in my project. In this case, the flake.nix of base would be explicit however we reduce the boilerplate involved, no?
When using nixpkgs, we are pinning the versions inside the flake.nix, I dont see the issues related to channels creeping unless don’t specify the sha? (again, I could be wrong with my limited experience and knowledge of Nix)