[Nix-dev] Temporarily not using ~/.nixpkgs/config.nix

Linus Heckemann acc at sphalerite.org
Sun Mar 26 17:37:49 CEST 2017


On 26/03/17 16:30, Eike wrote:
> Is there a way to temporarily disable evaluating ~/.nixpkgs/config.nix?
> I looked at http://nixos.org/nixpkgs/manual/#chap-packageconfig, but
> couldn't find anything related.

See pkgs/top-level/impure.nix (found by grepping nixpkgs for
.nixpkgs/config.nix):

> config ? let
>     configFile = getEnv "NIXPKGS_CONFIG";
>     configFile2 = homeDir + "/.config/nixpkgs/config.nix";
>     configFile3 = homeDir + "/.nixpkgs/config.nix"; # obsolete
>   in
>     if configFile != "" && pathExists configFile then import configFile
>     else if homeDir != "" && pathExists configFile2 then import configFile2
>     else if homeDir != "" && pathExists configFile3 then import configFile3
>     else {}

If you set the environment variable NIXPKGS_CONFIG to point to a file
containing simply {} that should hopefully help.

Linus


More information about the nix-dev mailing list