-
Notifications
You must be signed in to change notification settings - Fork 49
/
flake.nix
65 lines (59 loc) · 1.94 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/haskell-updates";
flake-parts.url = "github:hercules-ci/flake-parts";
haskell-flake.url = "github:srid/haskell-flake";
flake-root.url = "github:srid/flake-root";
purescript-overlay.url = "github:thomashoneyman/purescript-overlay";
purescript-overlay.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ self, nixpkgs, haskell-flake, flake-root, flake-parts, purescript-overlay }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = nixpkgs.lib.systems.flakeExposed;
imports = [
haskell-flake.flakeModule
flake-root.flakeModule
];
perSystem = { self', pkgs, system, config,... }: {
# https://flake.parts/overlays#consuming-an-overlay
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
purescript-overlay.overlays.default
];
};
haskellProjects.default = {
basePackages = pkgs.haskellPackages;
devShell = {
enable = true;
mkShellArgs = {
shellHook = ''
export LD_LIBRARY_PATH=${pkgs.zlib.out}/lib:LD_LIBRARY_PATH
'';
};
tools = haskellPackages: {
inherit (haskellPackages)
zlib;
};
hlsCheck.enable = false;
};
# exclude devShell, fixes duplicate definition
autoWire = [ "packages" "apps" "checks" ];
};
devShells.default = pkgs.mkShell {
inputsFrom = [
config.haskellProjects.default.outputs.devShell
];
buildInputs = [
pkgs.hello
pkgs.purs
pkgs.spago
pkgs.purs-tidy-bin.purs-tidy-0_10_0
pkgs.purs-backend-es
pkgs.purescript-language-server
];
};
packages.default = self'.packages.example;
};
};
}