-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
34 lines (32 loc) · 1.4 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
{
description = "lh-playground";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-22.05;
flake-utils.url = github:numtide/flake-utils;
liquidhaskell.url = github:plredmond/liquidhaskell/nix-flake;
liquidhaskell.inputs.nixpkgs.follows = "nixpkgs";
liquidhaskell.inputs.flake-utils.follows = "flake-utils";
};
outputs = { self, nixpkgs, flake-utils, liquidhaskell }: flake-utils.lib.eachDefaultSystem (system: {
devShell = self.defaultPackage.${system}.envFunc { withHoogle = true; };
defaultPackage =
let
pkgs = import nixpkgs {
inherit system;
overlays = [ liquidhaskell.overlay.${system} ];
};
# ghc version is coupled to the ghc version in the liquidhaskell flake,
# because that flake overrides the haskell package set for only one
# compiler
ghc = "ghc8107"; # Based on https://github.com/ucsd-progsys/liquid-fixpoint/blob/develop/stack.yaml#L3
src = pkgs.nix-gitignore.gitignoreSource [ "*.nix" "result" "build-env" "*.cabal" "deploy/" "dist/" ] ./.;
drv = pkgs.haskell.packages.${ghc}.callCabal2nix "lh-playground" src { };
in
pkgs.haskell.lib.overrideCabal drv (old: {
# enableLibraryProfiling is coupled to the value in the
# liquidhaskell flake
enableLibraryProfiling = false;
buildTools = old.buildTools or [ ] ++ [ pkgs.z3 ];
});
});
}