-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
85 lines (76 loc) · 2.63 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
{
description = "Example Haskell flake showing overrides and adding stuff to the dev shell";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
nixConfig.allow-import-from-derivation = true; # cabal2nix uses IFD
outputs = { self, nixpkgs, flake-utils }:
let
ghcVer = "ghc925";
makeHaskellOverlay = overlay: final: prev: {
haskell = prev.haskell // {
packages = prev.haskell.packages // {
${ghcVer} = prev.haskell.packages."${ghcVer}".override (oldArgs: {
overrides =
prev.lib.composeExtensions (oldArgs.overrides or (_: _: { }))
(overlay prev);
});
};
};
};
out = system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
config.allowBroken = true;
};
in
{
packages = rec {
default = lti13;
inherit (pkgs.haskell.packages.${ghcVer}) lti13 yesod-auth-lti13;
};
# for debugging
inherit pkgs;
devShells.default =
let haskellPackages = pkgs.haskell.packages.${ghcVer};
in
haskellPackages.shellFor {
packages = p: with self.packages.${system}; [ lti13 yesod-auth-lti13 ];
withHoogle = true;
buildInputs = with haskellPackages; [
haskell-language-server
cabal-install
] ++ (with pkgs; [
hpack
]);
# Change the prompt to show that you are in a devShell
# shellHook = "export PS1='\\e[1;34mdev > \\e[0m'";
};
};
in
flake-utils.lib.eachDefaultSystem out // {
# this stuff is *not* per-system
overlays = {
default = makeHaskellOverlay
(prev: hfinal: hprev:
let hlib = prev.haskell.lib; in
{
lti13 = hprev.callCabal2nix "lti13" ./lti13 { };
yesod-auth-lti13 = hprev.callCabal2nix "yesod-auth-lti13" ./yesod-auth-lti13 { };
# spec calls google
oidc-client = hlib.dontCheck (hfinal.callHackageDirect
{
pkg = "oidc-client";
ver = "0.7.0.1";
sha256 = "sha256-nWEh9qwrQNlmYlztGw+F/r4SBWVHpc6aUeEq/8cDDXU=";
}
{ });
# For some reason (ghc bug) the test suite hangs.
ListLike = hlib.dontCheck hprev.ListLike;
});
};
};
}