Skip to content

Commit 7ab430d

Browse files
committed
Add a custom nix.conf file for CI tests
This should unstuck both #1579 and #1601 ... n.b. This is enabled only when `CI` env variable is set, to not bother normal users in their interactive tests ;)
1 parent e36a34c commit 7ab430d

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

test/nix.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
allow-import-from-derivation = true
2+
allowed-users = *
3+
builders-use-substitutes = true
4+
experimental-features = nix-command flakes
5+
keep-derivations = true
6+
keep-outputs = true
7+
max-jobs = auto
8+
substituters = https://cache.iog.io https://cache.nixos.org https://cache.ngi0.nixos.org/ https://cache.nixos.org/
9+
system-features = nixos-test benchmark big-parallel kvm
10+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo=

test/tests.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ printf "*** Cleaning package build directories..." >& 2
2020
rm -rvf */cabal.project.local */.ghc.environment* */dist */dist-newstyle */.stack-work
2121
echo >& 2
2222

23+
# This was needed is first place to make hix template / flake devShell examples
24+
# not require interactive user confirmation. Because the IOG nix cache settings
25+
# are defined in the `nixConfig` flake attribute.
26+
if [ ! -z ${CI+x} ]; then
27+
printf "*** Set custom nix.conf for CI ..." >& 2
28+
export XDG_CONFIG_HOME=$HOME/.config
29+
mkdir -p $XDG_CONFIG_HOME/nix
30+
cp ./nix.conf $XDG_CONFIG_HOME/nix
31+
echo >& 2
32+
fi
33+
2334
printf "*** Running the nix-build tests...\n" >& 2
2435
nix build $NIX_BUILD_ARGS \
2536
-I . -I .. \

0 commit comments

Comments
 (0)