on e94de40 help sign in
haskell.nix/test/regen.nix
68 lines 1.2 kB history raw
1# A script for regenerating nix for tests
2let
3 haskellNix = (import ../default.nix {});
4in
5{ pkgs ? import nixpkgs nixpkgsArgs
6, nixpkgs ? haskellNix.sources.nixpkgs
7, nixpkgsArgs ? haskellNix.nixpkgsArgs
8}:
10with pkgs;
12writeScript "regen-tests.sh" ''
13 #!${pkgs.runtimeShell}
15 set -euo pipefail
17 export PATH="${lib.makeBinPath [ coreutils glibc haskell-nix.nix-tools cabal-install haskell-nix.compiler.ghc865 ]}"
19 cabal_configure() {
20 cabal new-configure \
21 --with-compiler ghc-8.6.5 \
22 --constraint 'transformers == 0.5.6.2' \
23 --constraint 'process == 1.6.5.0'
24 }
26 plan_nix() {
27 plan-to-nix -o . --plan-json dist-newstyle/cache/plan.json
28 }
30 cabal_nix() {
31 cabal-to-nix $1.cabal > $1.nix
32 }
34 regen() {
35 cabal_configure
36 plan_nix
37 cabal_nix $1
38 }
40 cd builder-haddock
41 regen test-haddock
42 cd ..
44 cd cabal-22
45 regen project
46 cd ..
48 cd cabal-simple
49 regen cabal-simple
50 cd ..
52 cd cabal-sublib
53 regen cabal-sublib
54 cd ..
56 cd with-packages
57 regen test-with-packages
58 cd ..
60 cd stack-simple
61 stack-to-nix -o .
62 cd ..
64 cd shell-for
65 cabal_configure
66 plan-to-nix -o . --plan-json dist-newstyle/cache/plan.json --cabal-project cabal.project
67 cd ..
68''