-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
97 lines (89 loc) · 2.77 KB
/
flake.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{
description = "Working through 'Haskell in Depth'";
inputs = {
emacs-overlay.url = "github:nix-community/emacs-overlay";
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/release-21.05";
};
outputs = { self, emacs-overlay, flake-utils, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" ];
in
{
overlay = final: prev: {
haskellPackages = prev.haskellPackages.override {
overrides = hfinal: hprev: {
formatting = hprev.callHackageDirect
{
pkg = "formatting";
ver = "7.1.2";
sha256 = "sha256-sbHPbVcLDgymul0x0q2c7ZCej+0IV1P1aqGLt9JpfL0=";
}
{ };
};
};
myEmacs = prev.emacsWithPackagesFromUsePackage {
alwaysEnsure = true;
config = ./emacs.el;
};
};
} //
flake-utils.lib.eachSystem supportedSystems (system:
let
pkgs = import nixpkgs {
overlays = [
emacs-overlay.overlay
self.overlay
];
inherit system;
};
in
{
apps = {
du = flake-utils.lib.mkApp {
drv = self.packages.${system}.du;
};
radar = flake-utils.lib.mkApp {
name = "radar";
drv = self.defaultPackage.${system};
};
suntimes = flake-utils.lib.mkApp {
drv = self.packages.${system}.suntimes;
};
vocab-builder = flake-utils.lib.mkApp {
name = "vocab-builder";
drv = self.defaultPackage.${system};
};
};
defaultPackage = pkgs.symlinkJoin {
name = "haskell-in-depth";
paths = builtins.attrValues self.packages.${system};
};
devShell = with pkgs; mkShell {
buildInputs = with pkgs; [
cabal-install
cargo
ghcid
(
haskellPackages.ghcWithPackages (_:
builtins.concatMap
(pkg: pkg.getBuildInputs.haskellBuildInputs)
(builtins.attrValues self.packages.${system})
)
)
gitAndTools.pre-commit
haskell-language-server
haskellPackages.ormolu
haskellPackages.pointfree
myEmacs
nixpkgs-fmt
];
};
packages = {
containers-mini = pkgs.haskellPackages.callCabal2nix "containers-mini" ./containers-mini { };
du = pkgs.haskellPackages.callCabal2nix "du" ./du { };
haskell-in-depth = pkgs.haskellPackages.callCabal2nix "haskell-in-depth" self { };
suntimes = pkgs.haskellPackages.callCabal2nix "suntimes" ./suntimes { };
};
});
}