mirror of
https://github.com/NixOS/nix
synced 2025-07-09 03:43:54 +02:00
Add NIX_CONFIG env var for applying nix.conf overrides
This commit is contained in:
parent
21244e1062
commit
461cf2b856
4 changed files with 23 additions and 0 deletions
|
@ -16,3 +16,12 @@ 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 ]]
|
||||
|
||||
# Test that it's possible to load config from the environment
|
||||
prev=$(nix show-config | grep '^cores' | cut -d '=' -f 2 | xargs)
|
||||
export NIX_CONFIG="cores = 4242"$'\n'"experimental-features = nix-command flakes"
|
||||
exp_cores=$(nix show-config | grep '^cores' | cut -d '=' -f 2 | xargs)
|
||||
exp_features=$(nix show-config | grep '^experimental-features' | cut -d '=' -f 2 | xargs)
|
||||
[[ $prev != $exp_cores ]]
|
||||
[[ $exp_cores == "4242" ]]
|
||||
[[ $exp_features == "nix-command flakes" ]]
|
Loading…
Add table
Add a link
Reference in a new issue