-
Notifications
You must be signed in to change notification settings - Fork 118
/
flake.nix
61 lines (54 loc) · 1.79 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
{
description = "bloodhound";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
};
outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs { inherit system; };
disableTests = pkgs.haskell.lib.dontCheck;
enableTests = pkgs.haskell.lib.doCheck;
haskellPackages = pkgs.haskellPackages;
in
rec
{
packages.bloodhound =
disableTests (haskellPackages.callCabal2nix "bloodhound" ./. {
# Dependency overrides go here
});
packages.bloodhound-examples =
haskellPackages.callCabal2nix "bloodhound-examples" ./examples {
# Dependency overrides go here
bloodhound = packages.bloodhound;
};
defaultPackage = packages.bloodhound;
devShell =
let
scripts = pkgs.symlinkJoin {
name = "scripts";
paths = pkgs.lib.mapAttrsToList pkgs.writeShellScriptBin {
ormolu-ide = ''
${pkgs.ormolu}/bin/ormolu -o -XNoImportQualifiedPost $@
'';
};
};
in
pkgs.mkShell {
buildInputs = with haskellPackages; [
pkgs.docker-compose
haskell-language-server
ghcid
cabal-install
scripts
ormolu
];
inputsFrom = [
(enableTests self.defaultPackage.${system}).env
];
};
});
}