Skip to content

Commit 0875c0a

Browse files
authored
Nix improvements (#361)
1 parent 5d7f975 commit 0875c0a

File tree

4 files changed

+40
-33
lines changed

4 files changed

+40
-33
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
name: Cache ~/.stack
3030
with:
3131
path: ~/.stack
32-
key: ${{ runner.os }}-${{ matrix.ghc }}-v4
32+
key: ${{ runner.os }}-${{ matrix.ghc }}-v5
3333

3434
- name: Add ~/.local/bin to PATH
3535
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{ pkgs ? import ./haskell-pkgs.nix
2-
, haskellCompiler ? "ghc8101"
2+
, haskellCompiler ? "ghc8104"
33
}:
44
pkgs.haskell-nix.cabalProject {
55
src = pkgs.haskell-nix.haskellLib.cleanGit {

haskell-pkgs.nix

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
let
22
# Fetch the latest haskell.nix and import its default.nix
3-
haskellNix = import (builtins.fetchTarball{
4-
url = "https://github.com/input-output-hk/haskell.nix/archive/f6663a8449f5e4a7393aa24601600c8f6e352c97.tar.gz";
5-
}) {};
3+
haskellNix = import
4+
(builtins.fetchTarball {
5+
url = "https://github.com/input-output-hk/haskell.nix/archive/1b9b05beed75a1be98405501fbb33ac1f080069e.tar.gz";
6+
})
7+
{ };
68

7-
# haskell.nix provides access to the nixpkgs pins which are used by our CI,
8-
# hence you will be more likely to get cache hits when using these.
9-
# But you can also just use your own, e.g. '<nixpkgs>'.
10-
nixpkgsSrc = haskellNix.sources.nixpkgs-2003;
9+
# haskell.nix provides access to the nixpkgs pins which are used by our CI,
10+
# hence you will be more likely to get cache hits when using these.
11+
# But you can also just use your own, e.g. '<nixpkgs>'.
12+
nixpkgsSrc = haskellNix.sources.nixpkgs-2009;
1113

12-
# haskell.nix provides some arguments to be passed to nixpkgs, including some
13-
# patches and also the haskell.nix functionality itself as an overlay.
14+
# haskell.nix provides some arguments to be passed to nixpkgs, including some
15+
# patches and also the haskell.nix functionality itself as an overlay.
1416
nixpkgsArgs = haskellNix.nixpkgsArgs;
1517

16-
# import nixpkgs with overlays
18+
# import nixpkgs with overlays
1719
in
18-
import nixpkgsSrc nixpkgsArgs
20+
import nixpkgsSrc nixpkgsArgs

shell.nix

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
1-
{ pkgs ? import ./haskell-pkgs.nix}:
2-
1+
{ pkgs ? import ./haskell-pkgs.nix }:
32
let
43
hsPkgs = import ./. { inherit pkgs; };
54
in
6-
hsPkgs.shellFor {
7-
# Include only the *local* packages of your project.
8-
# packages = ps: with ps; [
9-
# ];
5+
hsPkgs.shellFor {
6+
# Include only the *local* packages of your project.
7+
# packages = ps: with ps; [
8+
# ];
109

11-
# Builds a Hoogle documentation index of all dependencies,
12-
# and provides a "hoogle" command to search the index.
13-
# withHoogle = true;
10+
# Builds a Hoogle documentation index of all dependencies,
11+
# and provides a "hoogle" command to search the index.
12+
# withHoogle = true;
1413

15-
# You might want some extra tools in the shell (optional).
16-
# Some common tools can be added with the `tools` argument
17-
tools = { cabal = "3.2.0.0"; hlint = "2.2.11"; };
18-
# See overlays/tools.nix for more details
14+
# You might want some extra tools in the shell (optional).
15+
# Some common tools can be added with the `tools` argument
16+
tools = {
17+
cabal = "3.2.0.0";
18+
hlint = "2.2.11";
19+
stylish-haskell = "0.12.2.0";
20+
};
21+
# See overlays/tools.nix for more details
1922

20-
# Some you may need to get some other way.
21-
buildInputs = with pkgs.haskellPackages;
22-
[ ghcid ];
23+
# Some you may need to get some other way.
24+
buildInputs = [
25+
pkgs.ghcid
26+
pkgs.nixpkgs-fmt
27+
];
2328

24-
# Prevents cabal from choosing alternate plans, so that
25-
# *all* dependencies are provided by Nix.
26-
exactDeps = true;
27-
}
29+
# Prevents cabal from choosing alternate plans, so that
30+
# *all* dependencies are provided by Nix.
31+
exactDeps = true;
32+
}

0 commit comments

Comments
 (0)