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

fix NIX_PATH for real #11079

Merged

Conversation

fricklerhandwerk
Copy link
Contributor

@fricklerhandwerk fricklerhandwerk commented Jul 11, 2024

with @roberth

Motivation

closes #9574

Context

Based on #7871 and #8902

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@github-actions github-actions bot added the with-tests Issues related to testing. PRs with tests have some priority label Jul 11, 2024
src/libexpr/eval-settings.cc Outdated Show resolved Hide resolved
@roberth roberth added bug settings Settings, global flags, nix.conf labels Jul 11, 2024
@roberth roberth changed the title fix NIX_PATH for real now [WIP] fix NIX_PATH for real Jul 11, 2024
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-07-17-nix-team-meeting-minutes-162/49255/1

- test restricted evaluation
- test precedence for setting the search path
@fricklerhandwerk fricklerhandwerk marked this pull request as ready for review July 23, 2024 16:52
@fricklerhandwerk fricklerhandwerk changed the title [WIP] fix NIX_PATH for real fix NIX_PATH for real Jul 23, 2024
@fricklerhandwerk fricklerhandwerk marked this pull request as draft July 23, 2024 17:57
src/libutil/config.cc Outdated Show resolved Hide resolved
This ensures that the overriding happens even when no config file
exists.

This can happen when running Nix in a bare sandbox, for example.
NIX_CONF_DIR is not set when running the tests on NixOS.
@roberth roberth marked this pull request as ready for review July 24, 2024 12:40
src/libstore/globals.cc Outdated Show resolved Hide resolved
@roberth
Copy link
Member

roberth commented Jul 24, 2024

github flakes VM test is flaky; second occurrence I know of: https://github.com/NixOS/nix/actions/runs/10076791399/job/27857897291?pr=11079

I'm rerunning it.

@fricklerhandwerk fricklerhandwerk enabled auto-merge (squash) July 24, 2024 20:05
@fricklerhandwerk fricklerhandwerk merged commit e062021 into NixOS:master Jul 24, 2024
12 checks passed
@fricklerhandwerk
Copy link
Contributor Author

@SuperSandro2000
Copy link
Member

I am not sure in which version the bug first appeared but maybe we can backport this to 2.23 at least?

@roberth
Copy link
Member

roberth commented Jul 26, 2024

Code has moved around a bit since 2.23, so git won't be of much help, but it's feasible.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-07-24-nix-team-meeting-minutes-164/49811/1

antoineco added a commit to antoineco/dotfiles that referenced this pull request Sep 10, 2024
Since Nix 2.24, NIX_PATH overrides any setting defined in nix.conf[1].
This renders the 'extra-nix-path' option set by the installer[2]
ineffective.

The problem only affects nix-darwin. In NixOS, NIX_PATH is defaulted to
the same value as the one set by the installer[3].

[1]: NixOS/nix#11079
[2]: https://github.com/DeterminateSystems/nix/blob/v2.24.6/flake.nix#L123
[3]: https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/misc/nixpkgs-flake.nix#L96-L102
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug settings Settings, global flags, nix.conf with-tests Issues related to testing. PRs with tests have some priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken NIX_PATH tracking issue
6 participants