Skip to content

Commit 578c0e9

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

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ printf "*** Cleaning package build directories..." >& 2
2020
rm -rvf */cabal.project.local */.ghc.environment* */dist */dist-newstyle */.stack-work
2121
echo >& 2
2222

23+
if [ ! -z ${CI+x} ]; then
24+
printf "*** Set custom nix.conf for CI ..." >& 2
25+
export XDG_CONFIG_HOME=$HOME/.config
26+
mkdir -p $XDG_CONFIG_HOME/nix
27+
cp ./nix.conf $XDG_CONFIG_HOME/nix
28+
echo >& 2
29+
fi
30+
2331
printf "*** Running the nix-build tests...\n" >& 2
2432
nix build $NIX_BUILD_ARGS \
2533
-I . -I .. \

0 commit comments

Comments
 (0)