1{ haskell
2, lib
3
4# The following are only needed for the passthru.tests:
5, cacert
6, git
7, nodejs
8, purescript
9, runCommand
10}:
11
12let
13 spago =
14 lib.pipe
15 haskell.packages.ghc90.spago
16 [ haskell.lib.compose.justStaticExecutables
17 (haskell.lib.compose.overrideCabal (oldAttrs: {
18 changelog = "https://github.com/purescript/spago/releases/tag/${oldAttrs.version}";
19 }))
20 ];
21in
22
23spago.overrideAttrs (oldAttrs: {
24 passthru = (oldAttrs.passthru or {}) // {
25 updateScript = ./update.sh;
26
27 # These tests can be run with the following command. The tests access the
28 # network, so they cannot be run in the nix sandbox. sudo is needed in
29 # order to change the sandbox option.
30 #
31 # $ sudo nix-build -A spago.passthru.tests --option sandbox relaxed
32 #
33 tests =
34 runCommand
35 "spago-tests"
36 {
37 __noChroot = true;
38 nativeBuildInputs = [
39 cacert
40 git
41 nodejs
42 purescript
43 spago
44 ];
45 }
46 ''
47 # spago expects HOME to be set because it creates a cache file under
48 # home.
49 HOME=$(pwd)
50
51 spago --verbose init
52 spago --verbose build
53 spago --verbose test
54
55 touch $out
56 '';
57 };
58})