Skip to content

Commit a2a29bd

Browse files
authored
Use nix --accept-flake-config option rather than yes | in CI tests (#1626)
https://nixos.org/manual/nix/unstable/command-ref/conf-file.html#conf-accept-flake-config
1 parent de7a027 commit a2a29bd

File tree

4 files changed

+5
-22
lines changed

4 files changed

+5
-22
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ steps:
4141

4242
- label: 'Check that the haskell.nix roots do not require IFDs'
4343
command:
44-
- yes | nix build .#roots.x86_64-linux --option allow-import-from-derivation false
44+
- nix build .#roots.x86_64-linux --accept-flake-config --option allow-import-from-derivation false
4545
agents:
4646
system: x86_64-linux
4747

scripts/update-external.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,7 @@ in
3535
3636
cd ..
3737
38-
yes | nix --experimental-features 'nix-command flakes' flake lock --update-input ${name}
38+
nix flack lock --accept-flake-config \
39+
--experimental-features 'nix-command flakes' \
40+
--update-input ${name}
3941
''

test/nix.conf

Lines changed: 0 additions & 10 deletions
This file was deleted.

test/tests.sh

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,7 @@ 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
23+
alias nix="nix --accept-flake-config"
3324

3425
printf "*** Running the nix-build tests...\n" >& 2
3526
nix build $NIX_BUILD_ARGS \

0 commit comments

Comments
 (0)