Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplicate some Flake inputs #1128

Merged
merged 1 commit into from
Apr 15, 2024
Merged

Conversation

Cu3PO42
Copy link
Contributor

@Cu3PO42 Cu3PO42 commented Apr 14, 2024

Hi! This is a PR in response to #1122.

I have specified some additional inputs.follows rules to de-duplicate shared dependencies.

devenv is still pulling three copies of nixpkgs into the lockfile. One is the actual input, the other two are used for regression tests by nix and pre-commit-hooks respectively. They should never be instantiated and downloaded, so I have chosen to leave them in, but you could also make the argument that they 'pollute' the lockfile and should be overriden as well. I'd be happy to change that.

Unfortunately, I was unable to resolve what I consider to be the biggest problem: devenv pulling in another copy of itself. Right now, devenv 1.0 includes a reference to the main branch of cachix, which includes a reference to the python-rewrite branch of devenv. Since that branch does not itself contain a reference to cachix, the chain stops there. But if you ever were to update the version of devenv used by cachix, you'd increase the length of the chain by one. If you then updated the version of cachix referenced by devenv, you'd end up with

devenv (new version) -> cachix (new version) -> devenv (1.0) -> cachix (older version) -> devenv (python rewrite)

This chain would be evergrowing.

It probably is possible to hack around this issue by removing the direct input references on one another and using flake-compat to construct mutually recursive flakes, but I'm not sure that should be the way forward.

I initially intended to resolve this by adding cachix.inputs.devenv.follows = "self", but Nix does not appear to accept this.

From any given Flake that includes devenv (or cachix) it is possible to resolve this by specifying both inputs and adding the necessary overrides, but that also means specifying all overrides that are included here. I would not consider that 'user-friendly'.

@domenkozar domenkozar merged commit a518ec6 into cachix:main Apr 15, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants