NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.81k stars 1.52k forks source link

~/.config/nix/nix.conf overrides values of /etc/nix/nix.conf #2149

Open domenkozar opened 6 years ago

domenkozar commented 6 years ago

I'd expect substituters in ~/.config/nix/nix.conf to be appended on top of the system /etc/nix/nix.conf, but currently, Nix overrides them.

LnL7 commented 6 years ago

There's extra-substituters, same for certain other options.

edolstra commented 6 years ago

I'm not sure if append is desirable behaviour in general. What if you want to override? Also, should it prepend or append?

Maybe appending could be a special syntax, e.g.

substituters += https://...

or --substituters +https://....

dezgeg commented 6 years ago

For the command line syntax, the GNU command line guidelines for long options generally supports --foo=bar to be equivalent to --foo bar. So if we supported that, then --substituters+=https://foo.bar would be a quite logical extension.

ElvishJerricco commented 6 years ago

Additionally, it'd be nice if there were ways to specify many config files other than the two default ones.

grahamc commented 6 years ago

Configuration files can use import to load additional config files. Does that suit your needs, @ElvishJerricco?

ElvishJerricco commented 6 years ago

@grahamc Had no idea.That's awesome. Is that documented? And I assume it still causes overwriting of options?

grahamc commented 6 years ago

Oops, I meant include -- yes it is documented: https://nixos.org/nix/manual/#description-41

domenkozar commented 4 years ago

Using += seems fine to me as long as there's an equivalent for --options substituters ..., something like --options-append substituters ...

NorfairKing commented 3 years ago

I just ran into a very confusing issue where I had a shell alias in a shellHook with multiple --option trusted-public-keys options. Suddenly my machine was recompiling the linux kernel after a nixpkgs upgrade. I couldn't figure out what was wrong until @domenkozar pointed out that --option trusted-public-keys overrides instead of appending. So :+1: on this issue!

domenkozar commented 3 years ago

This seems to be addressed with https://github.com/NixOS/nix/commit/ff4dea63c9403880500f82ce273713ecf793d2d9 (on master), but I still need to confirm that.

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

NorfairKing commented 3 years ago

Not stale.

stale[bot] commented 2 years ago

I marked this as stale due to inactivity. → More info

NorfairKing commented 2 years ago

Not stale bot marked as not stale due to activity of the stale bot.