-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Motivation: maintain project-level configuration files. Document the whole situation a bit better so that it corresponds to the implementation, and add NIX_USER_CONF_FILES that allows overriding which user files Nix will load during startup.
- Loading branch information
Showing
10 changed files
with
86 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
source common.sh | ||
|
||
# Test that files are loaded from XDG by default | ||
export XDG_CONFIG_HOME=/tmp/home | ||
export XDG_CONFIG_DIRS=/tmp/dir1:/tmp/dir2 | ||
files=$(nix-build --verbose --version | grep "User config" | cut -d ':' -f2- | xargs) | ||
[[ $files == "/tmp/home/nix/nix.conf:/tmp/dir1/nix/nix.conf:/tmp/dir2/nix/nix.conf" ]] | ||
|
||
# Test that setting NIX_USER_CONF_FILES overrides all the default user config files | ||
export NIX_USER_CONF_FILES=/tmp/file1.conf:/tmp/file2.conf | ||
files=$(nix-build --verbose --version | grep "User config" | cut -d ':' -f2- | xargs) | ||
[[ $files == "/tmp/file1.conf:/tmp/file2.conf" ]] | ||
|
||
# Test that it's possible to load the config from a custom location | ||
here=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")") | ||
export NIX_USER_CONF_FILES=$here/config/nix-with-substituters.conf | ||
var=$(nix show-config | grep '^substituters =' | cut -d '=' -f 2 | xargs) | ||
[[ $var == https://example.com ]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
experimental-features = nix-command | ||
substituters = https://example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters