-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathflake.nix
50 lines (47 loc) · 1.62 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
{
description = "apecs";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-23.11";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = inputs:
let
overlay = final: prev: {
haskell = prev.haskell // {
packageOverrides = hfinal: hprev:
prev.haskell.packageOverrides hfinal hprev // {
apecs = hfinal.callCabal2nix "apecs" ./apecs { };
apecs-stm = hfinal.callCabal2nix "apecs-stm" ./apecs-stm { };
apecs-physics = hfinal.callCabal2nix "apecs-physics" ./apecs-physics { };
apecs-gloss = hfinal.callCabal2nix "apecs-gloss" ./apecs-gloss { };
examples = hfinal.callCabal2nix "examples" ./examples { };
};
};
examples = final.haskell.lib.compose.justStaticExecutables final.haskellPackages.examples;
};
perSystem = system:
let
pkgs = import inputs.nixpkgs { inherit system; overlays = [ overlay ]; };
hspkgs = pkgs.haskellPackages;
in
{
devShell = hspkgs.shellFor {
withHoogle = true;
packages = p: [
p.apecs
p.apecs-stm
p.apecs-physics
p.apecs-gloss
p.examples
];
buildInputs = [
hspkgs.cabal-install
hspkgs.haskell-language-server
hspkgs.hlint
hspkgs.ormolu
pkgs.bashInteractive
];
};
defaultPackage = pkgs.examples;
};
in
{ inherit overlay; } // inputs.flake-utils.lib.eachDefaultSystem perSystem;
}