-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
83 lines (82 loc) · 2.84 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{
description = "canica's description";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/2df15ba83d0510a56f2583fd3481723835acb5a1";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ] (system:
let
overlays = [ ];
pkgs =
import nixpkgs { inherit system overlays; config.allowBroken = true; };
haskellPackages = pkgs.haskellPackages.override {
overrides = self: super:
# https://github.com/NixOS/nixpkgs/issues/140774#issuecomment-976899227
let
workaround140774 = hpkg: with pkgs.haskell.lib;
overrideCabal hpkg (drv: {
enableSeparateBinOutput = false;
});
in
{
ghcid = workaround140774 super.ghcid;
ormolu = workaround140774 super.ormolu;
hylide = self.callPackage ./hylide { };
hylogen = self.callPackage ./hylogen { };
fsnotify = pkgs.haskell.lib.dontCheck (haskellPackages.callHackage "fsnotify" "0.2.1.2" { });
};
};
project = returnShellEnv:
haskellPackages.developPackage {
inherit returnShellEnv;
name = "canica";
root = ./.;
withHoogle = false;
overrides = self: super:
# Use callCabal2nix to override Haskell dependencies here
# cf. https://tek.brick.do/K3VXJd8mEKO7
let
workaround140774 = hpkg: with pkgs.haskell.lib;
overrideCabal hpkg (drv: {
enableSeparateBinOutput = false;
});
in
{
ghcid = workaround140774 super.ghcid;
ormolu = workaround140774 super.ormolu;
};
modifier = drv:
pkgs.haskell.lib.addBuildTools drv
(with haskellPackages; [
# Specify your build/dev dependencies here.
cabal-install
cabal-fmt
ghcid
ormolu
haskell-language-server
pkgs.nixpkgs-fmt
hylide
hylogen
cabal2nix
reflex-dom-core
reflex
ghc-prim
ghcjs-dom
jsaddle
jsaddle-warp
clay
]);
};
in
{
# Used by `nix build` & `nix run` (prod exe)
defaultPackage = project false;
# Used by `nix develop` (dev shell)
devShell = project true;
});
}