-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
88 lines (82 loc) · 3 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
84
85
86
87
88
{
description = "sydml";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { flake-utils, self, nixpkgs, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
hlib = pkgs.haskell.lib.compose;
hpkgs = pkgs.haskell.packages.ghc98.extend (final: prev: {
sydml = hlib.dontCheck (final.callCabal2nix "sydml" ./. {});
# overly strict: base
monadic-recursion-schemes = hlib.doJailbreak prev.monadic-recursion-schemes;
# overly strict: base, bytestring, deepseq
# qbe = hlib.doJailbreak prev.qbe;
qbe = prev.callCabal2nix "qbe" ./vendor/qbe-hs {};
# missing features, broken tests
tree-sitter = prev.callCabal2nix "tree-sitter" ./vendor/haskell-tree-sitter/tree-sitter {};
# broken tests
dependent-hashmap = hlib.markUnbroken (hlib.dontCheck prev.dependent-hashmap);
# out of date (we insist on using latest for the sole reason of
# including the dual sperm operator, (<>:~).)
lens = prev.lens_5_3_2;
tree-sitter-sydml = import ./tree-sitter-sydml {
inherit pkgs hpkgs system inputs;
};
# tree-sitter-sydml = prev.callCabal2nix "tree-sitter-sydml" ./tree-sitter-sydml {};
});
in rec {
packages.default = (hpkgs.callCabal2nix "sydml" ./. {})
.overrideAttrs (final: prev: {
propagatedBuildInputs = with pkgs; [
qbe
gcc
] ++ prev.propagatedBuildInputs;
nativeBuildInputs = [
pkgs.tree-sitter
] ++ prev.nativeBuildInputs;
doCheck = false; # HACK: for convenience of development.
});
checks.default = packages.default
.overrideAttrs (final: prev: {
doCheck = true;
});
checks.tree-sitter-sydml = hpkgs.tree-sitter-sydml
.overrideAttrs (final: prev: {
doCheck = true;
});
# checks.default = (hpkgs.callCabal2nix "sydml-test" ./. {})
# .overrideAttrs (final: prev: {
# nativeBuildInputs = [
# pkgs.tree-sitter
# ] ++ prev.nativeBuildInputs;
# });
devShells.default = hpkgs.shellFor {
packages = p: [
p.sydml
# p.presydc
];
nativeBuildInputs = [
hpkgs.cabal-fmt
hpkgs.fourmolu
hpkgs.haskell-language-server
hpkgs.cabal-install
hpkgs.hasktags
pkgs.tree-sitter
(hpkgs.calligraphy.overrideAttrs (final: prev: {
propagatedBuildInputs = [
pkgs.graphviz
] ++ prev.propagatedBuildInputs;
}))
];
propagatedBuildInputs = with pkgs; [
qbe
gcc
];
withHoogle = true;
};
});
}