-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdefault.nix
49 lines (43 loc) · 1.12 KB
/
default.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
{ compiler ? "ghc92" }:
let
sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs {};
gitignore = pkgs.nix-gitignore.gitignoreSourcePure [ ./.gitignore ];
myHaskellPackages = pkgs.haskell.packages.${compiler}.override {
overrides = hself: hsuper: {
"laop" =
hself.callCabal2nix
"laop"
(gitignore ./.)
{};
};
};
shell = myHaskellPackages.shellFor {
packages = p: [
p."laop"
];
buildInputs = with pkgs.haskellPackages; [
# cabal
cabal-install
(import sources.niv {}).niv
pkgs.nixpkgs-fmt
(pkgs.haskell-language-server.override {
supportedGhcVersions = [ "92" ];
})
];
withHoogle = false; # If 'true' it gives an error because the library only depends on
# 'base'
};
exe = pkgs.haskell.lib.justStaticExecutables (myHaskellPackages."laop");
docker = pkgs.dockerTools.buildImage {
name = "laop";
config.Cmd = [ "${exe}/bin/laop" ];
};
in
{
inherit shell;
inherit exe;
inherit docker;
inherit myHaskellPackages;
"laop" = myHaskellPackages."laop";
}