~/.nixpkgs -> ~/.config/nixpkgs

The former is still respected as a fallback for config.nix for
backwards compatibility (but not for overlays because they're a new
feature).
This commit is contained in:
Eelco Dolstra
2017-02-01 16:07:55 +01:00
parent 7dacca324d
commit 9d6a55aefd
11 changed files with 24 additions and 22 deletions
+5 -3
View File
@@ -17,13 +17,15 @@ in
system ? builtins.currentSystem
, # Fallback: The contents of the configuration file found at $NIXPKGS_CONFIG or
# $HOME/.nixpkgs/config.nix.
# $HOME/.config/nixpkgs/config.nix.
config ? let
configFile = getEnv "NIXPKGS_CONFIG";
configFile2 = homeDir + "/.nixpkgs/config.nix";
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 {}
, # Overlays are used to extend Nixpkgs collection with additional
@@ -31,7 +33,7 @@ in
# fix-point made by Nixpkgs.
overlays ? let
dirPath = try (if pathExists <nixpkgs-overlays> then <nixpkgs-overlays> else "") "";
dirHome = homeDir + "/.nixpkgs/overlays";
dirHome = homeDir + "/.config/nixpkgs/overlays";
dirCheck = dir: dir != "" && pathExists (dir + "/.");
overlays = dir:
let content = readDir dir; in