-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
follows behavior for flakes used as inputs #3602
Comments
I marked this as stale due to inactivity. → More info |
The implementation of follows and overrides are related, so I think changing follows behavior depends on #4004 |
I also just encountered this bug. I have, in the inputs section of my main nixos config flake:
then I made (programatically as part of my nixos system generation) a small flake which I registered as 'pkgs' with nothing but the following flake.nix: (the nix store path points to the current rev of my main nixos config flake)
the idea was to allow commands like
It seems that "follows" attributes are being interpreted from the I would expect that the follows line I have written would have the same effect as putting
in the
there. |
PR #4641 seems to fix this issue? |
I just wanted to add in a similar issue I'm having in the hopes that maybe someone can help me. So I have a flake: {
description = "The www development shell";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs-fmt.url = "github:nix-community/nixpkgs-fmt";
outputs = { self, nixpkgs, flake-utils, nixpkgs-fmt }:
flake-utils.lib.eachDefaultSystem
(system:
let pkgs = nixpkgs.legacyPackages.${system}; in
{
devShell = pkgs.mkShell {
buildInputs = [
nixpkgs-fmt
];
};
}
);
} which fails on
|
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/possible-nix-flake-hierarchical-lookup-bug/14057/2 |
The feature is especially broken in nix: nixFlake suffers from an issue when using "follows" keyword: NixOS/nix#3602 A solution here https://discourse.nixos.org/t/flake-how-make-nixpkgs-self-follow-another-inputs-nixpkgs/10867 presents how to set self.inputs from children flakes so that's what we end up doing
nixFlake suffers from a bug when using "follows" keyword: NixOS/nix#3602
nixFlake suffers from a bug when using "follows" keyword: NixOS/nix#3602
nixFlake suffers from a bug when using "follows" keyword: NixOS/nix#3602
I recently adopted A -> B -> C -> D -> nixpkgs C also has nixpkgs as an input, and has a
When going "up a level", it should have been looking for EDIT: I can confirm that this issue still exists in Nix 2.8.0pre20220413_0e58aff. |
Also happening on the latest master:
|
I'm still seeing this issue on |
,I'm in the same boat, observing this behavior on |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
I had an issue like this, not sure if exactly the same case, but it was solved for me some time between Nix 2.13.5 and 2.18.4. |
Follows seems to break when a flake that has follows is used as an input for another flake. For example for a circular dependency flakeB<->flakeC, if flakeA inputs flakeB it causes a circular import error. If A->B->C and A->D->C2 but B follows D/C, the follows works, but if another flake inputs A, B no longer follows D/C.
The RFC says follows should be a path from the root flake, but it looks like sometimes the path is actually treated as relative
nix/src/libexpr/flake/flake.cc
Line 366 in 5f64655
Not sure what the intended behavior is, but it seems kind of brittle to require a flake to know the path it is being input along, and it might be better to always treat a follows as relative to the flake where it is defined.
The text was updated successfully, but these errors were encountered: