@@ -20,16 +20,15 @@ printf "*** Cleaning package build directories..." >& 2
2020rm -rvf * /cabal.project.local * /.ghc.environment* * /dist * /dist-newstyle * /.stack-work
2121echo >& 2
2222
23- alias nix=" nix --accept-flake-config"
24-
2523printf " *** Running the nix-build tests...\n" >& 2
2624nix build $NIX_BUILD_ARGS \
27- -I . -I .. \
28- --option restrict-eval true \
29- --option allowed-uris " https://github.com/NixOS https://github.com/input-output-hk" \
30- --no-link --keep-going -f default.nix \
31- --argstr compiler-nix-name $GHC \
32- --arg CADerivationsEnabled $NIX_CA_DERIVATIONS
25+ --accept-flake-config \
26+ -I . -I .. \
27+ --option restrict-eval true \
28+ --option allowed-uris " https://github.com/NixOS https://github.com/input-output-hk" \
29+ --no-link --keep-going -f default.nix \
30+ --argstr compiler-nix-name $GHC \
31+ --arg CADerivationsEnabled $NIX_CA_DERIVATIONS
3332echo >& 2
3433
3534printf " *** Running the unit tests... " >& 2
@@ -125,19 +124,43 @@ else
125124fi
126125
127126printf " *** Checking the maintainer scripts...\n" >& 2
128- nix build $NIX_BUILD_ARGS --no-link --keep-going -f ../build.nix --argstr compiler-nix-name $GHC maintainer-scripts
127+ nix build $NIX_BUILD_ARGS \
128+ --accept-flake-config \
129+ --no-link \
130+ --keep-going \
131+ -f ../build.nix \
132+ --argstr compiler-nix-name $GHC \
133+ maintainer-scripts
129134echo >& 2
130135
131136printf " *** Checking that plan construction works with extra Hackages...\n" >& 2
132- nix build $NIX_BUILD_ARGS --no-link \
133- -f ./default.nix --argstr compiler-nix-name $GHC \
137+ nix build $NIX_BUILD_ARGS \
138+ --accept-flake-config \
139+ --no-link \
140+ -f ./default.nix \
141+ --argstr compiler-nix-name $GHC \
134142 extra-hackage.run.project.plan-nix
135143echo >& 2
136144
137145printf " *** Checking that package with extra Hackages can be build...\n" >& 2
138- nix build $NIX_BUILD_ARGS --no-link \
139- -f ./default.nix --argstr compiler-nix-name $GHC \
146+ nix build $NIX_BUILD_ARGS \
147+ --accept-flake-config \
148+ --no-link \
149+ -f ./default.nix \
150+ --argstr compiler-nix-name $GHC \
140151 extra-hackage.run.project.hsPkgs.external-package-user.components.exes.external-package-user
141152echo >& 2
142153
154+ printf " *** End-2-end test of hix project initialization and flakes development shell ...\n" >& 2
155+ HASKELL_NIX=$( pwd) /..
156+ cd $( mktemp -d)
157+ nix-shell -p cabal-install --run " cabal update; cabal unpack hello"
158+ cd hello-*
159+ nix run $HASKELL_NIX #hix -- init
160+ nix develop \
161+ --override-input haskellNix $HASKELL_NIX \
162+ --accept-flake-config \
163+ -c cabal build
164+ echo >& 2
165+
143166printf " \n*** Finished successfully\n" >& 2
0 commit comments