Skip to content
This repository has been archived by the owner on Feb 13, 2021. It is now read-only.

Commit

Permalink
Use same haskell.nix version for stack/cabal + cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
infinisil committed Jul 25, 2020
1 parent 642c8a8 commit 4a160ef
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 21 deletions.
4 changes: 2 additions & 2 deletions templates/haskell.nix-cabal/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This can be done either using `nix-shell`:

```
$ nix-shell
[nix-shell:~/all-hies/templates/haskell.nix]$
[nix-shell:~/all-hies/templates/haskell.nix-cabal]$
```

Or automatically when you enter the project directory using [direnv](https://direnv.net/) or [lorri](https://github.com/target/lorri) (by running `lorri init` first). Note that entering the environment the first time will take quite some time due to how haskell.nix works.
Expand All @@ -51,7 +51,7 @@ In this environment HIE is available, which you can verify works with the `hie`
```
$ hie
[...]
/home/infinisil/all-hies/templates/haskell.nix/Main.hs: OK
/home/infinisil/all-hies/templates/haskell.nix-cabal/Main.hs: OK
```

The easiest way to get your editor to find HIE is to just start it in this environment:
Expand Down
8 changes: 4 additions & 4 deletions templates/haskell.nix-cabal/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ let
# Use this version for your project instead
/*
all-hies = fetchTarball {
# Insert the desired all-hies commit here
url = "https://github.com/input-output-hk/haskell.nix/tarball/000000000000000000000000000000000000000";
# Insert the correct hash after the first evaluation
# Insert the desired all-hies commit here
url = "https://github.com/infinisil/all-hies/tarball/000000000000000000000000000000000000000";
# Insert the correct hash after the first evaluation
sha256 = "0000000000000000000000000000000000000000000000000000";
};
*/
Expand All @@ -29,7 +29,7 @@ let
name = "all-hies-template";
src = ./.;
};
ghc = pkgs.buildPackages.pkgs.haskell-nix.compiler.ghc883;
ghc = pkgs.haskell-nix.compiler.ghc883;
modules = [{
# Make Cabal reinstallable
nonReinstallablePkgs = [ "rts" "ghc-heap" "ghc-prim" "integer-gmp" "integer-simple" "base" "deepseq" "array" "ghc-boot-th" "pretty" "template-haskell" "ghcjs-prim" "ghcjs-th" "ghc-boot" "ghc" "Win32" "array" "binary" "bytestring" "containers" "directory" "filepath" "ghc-boot" "ghc-compact" "ghc-prim" "hpc" "mtl" "parsec" "process" "text" "time" "transformers" "unix" "xhtml" "terminfo" ];
Expand Down
4 changes: 2 additions & 2 deletions templates/haskell.nix-stack/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This can be done either using `nix-shell`:

```
$ nix-shell
[nix-shell:~/all-hies/templates/haskell.nix]$
[nix-shell:~/all-hies/templates/haskell.nix-stack]$
```

Or automatically when you enter the project directory using [direnv](https://direnv.net/) or [lorri](https://github.com/target/lorri) (by running `lorri init` first). Note that entering the environment the first time will take quite some time due to how haskell.nix works.
Expand All @@ -51,7 +51,7 @@ In this environment HIE is available, which you can verify works with the `hie`
```
$ hie
[...]
/home/infinisil/all-hies/templates/haskell.nix/Main.hs: OK
/home/infinisil/all-hies/templates/haskell.nix-stack/Main.hs: OK
```

The easiest way to get your editor to find HIE is to just start it in this environment:
Expand Down
12 changes: 5 additions & 7 deletions templates/haskell.nix-stack/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
let
haskellNixSrc = fetchTarball {
url = "https://github.com/input-output-hk/haskell.nix/tarball/4219882774edb7a5e8382c3c6c421f2e907ee262";
sha256 = "05ymnlnyx9hnb9i3zpppijz32kwk1am1pabchkpl9s4dh0qkkhim";
url = "https://github.com/input-output-hk/haskell.nix/tarball/af5998fe8d6b201d2a9be09993f1b9fae74e0082";
sha256 = "0z5w99wkkpg2disvwjnsyp45w0bhdkrhvnrpz5nbwhhp21c71mbn";
};
haskellNix = import haskellNixSrc {};

Expand All @@ -10,9 +10,9 @@ let
# Use this version for your project instead
/*
all-hies = fetchTarball {
# Insert the desired all-hies commit here
url = "https://github.com/input-output-hk/haskell.nix/tarball/000000000000000000000000000000000000000";
# Insert the correct hash after the first evaluation
# Insert the desired all-hies commit here
url = "https://github.com/infinisil/all-hies/tarball/000000000000000000000000000000000000000";
# Insert the correct hash after the first evaluation
sha256 = "0000000000000000000000000000000000000000000000000000";
};
*/
Expand All @@ -37,7 +37,6 @@ let
in set.all-hies-template.components.exes.all-hies-template // {
env = set.shellFor {
packages = p: [ p.all-hies-template ];
#exactDeps = true;
tools = {
hie = "unstable";
};
Expand All @@ -46,5 +45,4 @@ in set.all-hies-template.components.exes.all-hies-template // {
export HIE_HOOGLE_DATABASE=$(realpath "$(dirname "$(realpath "$(which hoogle)")")/../share/doc/hoogle/default.hoo")
'';
};
inherit pkgs;
}
2 changes: 1 addition & 1 deletion templates/haskell.nix-stack/stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
# resolver: ./custom-snapshot.yaml
# resolver: https://example.com/snapshots/2018-01-01.yaml
resolver: lts-16.4
resolver: lts-15.12

# User packages to be built.
# Various formats can be used as shown in the example below.
Expand Down
4 changes: 2 additions & 2 deletions templates/nixpkgs-cabal/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This can be done either using `nix-shell`:

```
$ nix-shell
[nix-shell:~/all-hies/templates/haskell.nix]$
[nix-shell:~/all-hies/templates/nixpkgs-cabal]$
```

Or automatically when you enter the project directory using [direnv](https://direnv.net/) or [lorri](https://github.com/target/lorri) (by running `lorri init` first)
Expand All @@ -50,7 +50,7 @@ In this environment HIE is available, which you can verify works with the `hie`
```
$ hie
[...]
/home/infinisil/all-hies/templates/haskell.nix/Main.hs: OK
/home/infinisil/all-hies/templates/nixpkgs-cabal/Main.hs: OK
```

The easiest way to get your editor to find HIE is to just start it in this environment:
Expand Down
6 changes: 3 additions & 3 deletions templates/nixpkgs-cabal/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ let
# Use this version for your project instead
/*
all-hies = fetchTarball {
# Insert the desired all-hies commit here
url = "https://github.com/input-output-hk/haskell.nix/tarball/000000000000000000000000000000000000000";
# Insert the correct hash after the first evaluation
# Insert the desired all-hies commit here
url = "https://github.com/infinisil/all-hies/tarball/000000000000000000000000000000000000000";
# Insert the correct hash after the first evaluation
sha256 = "0000000000000000000000000000000000000000000000000000";
};
*/
Expand Down

0 comments on commit 4a160ef

Please sign in to comment.