forked from valderman/selda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
85 lines (73 loc) · 2.24 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 = "My haskell library";
nixConfig = {
extra-substituters = [
"https://haskell-language-server.cachix.org"
];
extra-trusted-public-keys = [
"haskell-language-server.cachix.org-1:juFfHrwkOxqIOZShtC4YC1uT1bBcq2RSvC7OMKx0Nz8="
];
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
hls.url = "github:haskell/haskell-language-server";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, hls, ... }:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
compilerVersion = "96";
haskellOverlay = hnew: hold: with pkgs.haskell.lib; { };
pkgs = import nixpkgs {
inherit system;
config = { allowUnfree = false; allowBroken = true; };
};
hsPkgs = pkgs.haskell.packages."ghc${compilerVersion}";
# modifier used in haskellPackages.developPackage
myModifier = drv:
pkgs.haskell.lib.addBuildTools drv (with hsPkgs; [
cabal-install
# TODO use the one from nixpkgs instead
# hls.packages.${system}."haskell-language-server-${compilerVersion}"
]);
# mkDevShell
mkPackage = name:
hsPkgs.developPackage {
root = pkgs.lib.cleanSource (builtins.toPath ./. + "/${name}");
name = name;
returnShellEnv = false;
withHoogle = true;
overrides = haskellOverlay;
modifier = myModifier;
};
in
{
packages = {
default = mkPackage "selda";
};
devShells = {
default = pkgs.mkShell {
name = "ghc${compilerVersion}-haskell-env";
packages =
let
ghcEnv = hsPkgs.ghcWithPackages (hs: [
hs.ghc
hs.haskell-language-server
hs.cabal-install
# prev.cairo
]);
in
[
ghcEnv
pkgs.postgresql.out
# ghc
pkgs.pkg-config
];
};
};
});
}