Improve support for Nix #43810
BCVerdouw
started this conversation in
Suggest an Idea
Replies: 1 comment 1 reply
-
|
After a month of silence on both this discussion, and the related PR, I'm curious. is the lack of engagement due to the manager I've worked on being too niche, or just due to the high volume of activity on Renovate as a whole? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Tell us more.
After a few days of trying (and failing) to get Renovate working the way I expected on my Nix projects I decided to take a look at the source code.
While doing so I identified two issues worth addressing.
I'm already working on a pull-request addressing these issues, this discussion is mostly meant as additional context to describe, and explain the changes I'm making.
Misinterpretation of the flake.lock
nodes.rootentry:In
lib/modules/manager/nix/extract.ts, on line 66, there's a check intended to skip inputs that are not defined innodes.root.While that seems to be a good idea to skip transitive dependencies, the current implementation does not account for the fact that the entries in
nodes.root.inputsmap input names to lockfile node names (inputs.<input name>: <lockfile node name>).To explain, assuming the following flake.nix and flake.lock:
flake.nix
flake.lock
{ "nodes": { "home-manager": { "inputs": { "nixpkgs": "nixpkgs" }, "locked": { "lastModified": 1779506708, "narHash": "sha256-QOD/CNm196nCJRheux/URi4/HE66fthdOMqCJoPP1Y0=", "owner": "nix-community", "repo": "home-manager", "rev": "3ee51fbdac8c8bdfe1e7e1fcaba6520a563f394f", "type": "github" }, "original": { "owner": "nix-community", "ref": "release-25.11", "repo": "home-manager", "type": "github" } }, "nixpkgs": { "locked": { "lastModified": 1779102034, "narHash": "sha256-vZJZjLo513IeI8hjzHFc6TDezUd4uCE2Eq4SNO3DNNg=", "owner": "NixOS", "repo": "nixpkgs", "rev": "687f05a9184cad4eaf905c48b63649e3a86f5433", "type": "github" }, "original": { "owner": "NixOS", "ref": "nixos-25.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_2": { "locked": { "lastModified": 1779796641, "narHash": "sha256-ZsIrKmhp4vbBXoXXmR/tBXA/UCsAQiJL9vsgZEduhVY=", "owner": "NixOS", "repo": "nixpkgs", "rev": "25f538306313eae3927264466c70d7001dcea1df", "type": "github" }, "original": { "owner": "NixOS", "ref": "nixos-25.11", "repo": "nixpkgs", "type": "github" } }, "root": { "inputs": { "home-manager": "home-manager", "nixpkgs": "nixpkgs_2" } } }, "root": "root", "version": 7 }The problem is that
nixpkgs_2is the lockfile representation ofinputs.nixpkgs, yet it will be skipped. Potentially even worse,nixpkgs, which is a transitive dependency, will be parsed as if it were the canonical representation ofinputs.nixpkgs.In this simplified example the issue is not a major concern because both entries happen to follow
nixos-25.11, however, that is not always the case.Hardcoded usage of
nixpkgsversioning only in nixos/nixpkgsWithin
lib/modules/manager/nix/extract.ts, on lines 151-154 there is a hardcoded check that enables thenixpkgsversioning scheme only fornixpkgs, sourced specifically fromhttps://github.com/NixOS/nixpkgs. As a result, other projects that follow the same versioning scheme, such as home-manager and aagl-gtk-on-nix, are currently excluded from this versioning logic.AI Assistance Notice:
Beta Was this translation helpful? Give feedback.
All reactions