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

nix: place extra-prefixed settings after their non-prefixed variants #1337

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

sandydoo
Copy link
Contributor

@sandydoo sandydoo commented Feb 14, 2025

Fixes #626.

Essentially a copy of NixOS's workaround: NixOS/nixpkgs#278064

Description

Nix has somewhat surprising semantics when extra-prefixed settings are used in the same file as their non-prefixed siblings. Any extra-prefixed setting is ignored if it is placed before its respective non-prefixed setting.

Reproduce

Add an extra substituter to your config:

{
  nix.settings.extra-substituters = [
    "https://devenv.cachix.org"
  ];
}

The nix.conf in /etc/nix/nix.conf will be sorted alphabetically:

# WARNING: this file is generated from the nix.* options in
# your nix-darwin configuration. Do not edit it!
...
extra-substituters = https://devenv.cachix.org
...
substituters = https://cache.nixos.org

Verify that the extra substituter is missing with nix config show.

Nix ignores the --extra-prefixed keys if they're followed by their non-prefixed siblings, as documented in NixOS/nix#9487.

@Enzime Enzime merged commit 7206892 into LnL7:master Feb 14, 2025
3 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.

Using extra-* settings in nix module doesn't work as expected
2 participants