-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
67 lines (56 loc) · 1.62 KB
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{ compiler ? "ghc902"
, ...
}:
let
## Import sources:
sources = import ./nix/sources.nix;
## Pinned nixpkgs:
pkgs = import sources.nixpkgs { };
## Get fourmolu source:
source-fourmolu = builtins.fetchTarball {
url = "https://hackage.haskell.org/package/fourmolu-0.8.2.0/fourmolu-0.8.2.0.tar.gz";
sha256 = "0m6hi8hr1lhy3l5yrnk7dllhwmp12gpkykxb2szal5sapd9qsdh9";
};
## Get the haskell set:
haskell = pkgs.haskell.packages.${compiler}.override {
overrides = self: super: with pkgs.haskell.lib; {
fourmolu = super.callCabal2nixWithOptions "fourmolu" source-fourmolu "--no-check" { };
Cabal = pkgs.haskellPackages.Cabal_3_6_3_0;
ghc-lib-parser = pkgs.haskellPackages.ghc-lib-parser_9_2_2_20220307;
};
};
## Get this package:
thisPackage = haskell.callCabal2nixWithOptions "habulara" ./. "--no-haddock" { };
## Get this package's Haskell dependencies:
thisPackageDeps = pkgs.haskell.lib.compose.getHaskellBuildInputs thisPackage;
## Get our GHC for development:
ghc = haskell.ghcWithPackages (_: thisPackageDeps);
in
pkgs.mkShell {
buildInputs = [
## Fancy stuff:
pkgs.figlet
pkgs.lolcat
## Release stuff:
pkgs.busybox
pkgs.gh
pkgs.git
pkgs.git-chglog
pkgs.upx
## Development and testing stuff:
(pkgs.rWrapper.override
{ packages = with pkgs.rPackages; [ stringi ]; }
)
## Haskell stuff:
ghc
haskell.fourmolu
pkgs.cabal-install
pkgs.cabal2nix
pkgs.haskell-language-server
pkgs.haskellPackages.apply-refact
pkgs.hlint
];
shellHook = ''
figlet -w 999 "HABULARA DEV SHELL" | lolcat -S 42
'';
}