forked from jonascarpay/calligraphy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
51 lines (48 loc) · 1.73 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
{
description = "calligraphy";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
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 // {
calligraphy = hfinal.callCabal2nix "calligraphy" ./. { };
};
};
calligraphy = final.haskell.lib.compose.justStaticExecutables final.haskellPackages.calligraphy;
};
perSystem = system:
let
pkgs = import inputs.nixpkgs { inherit system; overlays = [ overlay ]; };
mkShell = compiler:
let hspkgs = pkgs.haskell.packages.${compiler}; in
hspkgs.shellFor {
withHoogle = true;
packages = hpkgs: [ hpkgs.calligraphy ];
GHC_VERSION = compiler;
nativeBuildInputs = [
hspkgs.cabal-install
hspkgs.haskell-language-server
hspkgs.hlint
hspkgs.ormolu
pkgs.bashInteractive # see: https://discourse.nixos.org/t/interactive-bash-with-nix-develop-flake/15486
pkgs.graphviz
];
};
in
rec {
devShells = {
ghc922-shell = mkShell "ghc922";
ghc902-shell = mkShell "ghc902";
ghc8107-shell = mkShell "ghc8107";
ghc884-shell = mkShell "ghc884";
};
devShell = devShells.ghc922-shell;
packages.calligraphy = pkgs.calligraphy;
defaultPackage = pkgs.calligraphy;
};
in
{ inherit overlay; } // inputs.flake-utils.lib.eachDefaultSystem perSystem;
}