-
-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
config.allowAliases: add NIXPKGS_ALLOW_ALIASES to have an easy way to #201619
base: master
Are you sure you want to change the base?
Conversation
pkgs/top-level/config.nix
Outdated
if envVar != "" | ||
then envVar != "0" | ||
else true; | ||
defaultText = literalExpression ''builtins.getEnv "NIXPKGS_ALLOW_ALIASES" == "1" || true''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaultText = literalExpression ''builtins.getEnv "NIXPKGS_ALLOW_ALIASES" == "1" || true''; | |
defaultText = literalMD ''`true` unless `getEnv "NIXPKGS_ALLOW_ALIASES" == "0"`''; |
OfBorg is currently counterproductive for at least two alias problems.
Where (2) makes (1) even worse. Issue: |
disable aliases regardless of where nixpkgs is imported
9b8cb53
to
19fa462
Compare
I am not a big fan of environment variables in Nix expressions actually. This one is not as bad as |
Isn't it for backwards compatibility or to help the user find packages more easily ? as such there is little incentive to disable aliases (why would you ?). I think it's just a matter of people not knowing about it, rather than not knowing how to disable. I am also not very enthusiast of adding new environment variables. |
Indeed the existence of aliases is a good thing, and so is even the use of aliases by third party* code, because it improves the range of compatibility. That said, new names exist for a reason, and Nixpkgs is not third party code. (I hope my lecture wasn't too off-topic :)) * third party meaning: not Nixpkgs, not the configuration author, but another source such as home-manager, nixos-hardware, or nixos-mailserver. |
If you contribute regularly you want to have them disabled to not get reminded about them from ofborg. Also ofborg does not check for them in unfree packages which can lead to surprising breakes. An easy way to turn them of is to add |
if envVar != "" | ||
then envVar != "0" | ||
else true; | ||
defaultText = literalMD ''`true` unless `getEnv "NIXPKGS_ALLOW_ALIASES" == "0"`''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we should use some library function which accepts 0, 1, true, false, TRUE, True, FALSE and False just to make it easy for everyone.
disable aliases regardless of where nixpkgs is imported
i think one of the reasons we have many alias usages in nixpkgs is because it's not easy to disable aliases
Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes