-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathflake.nix
112 lines (92 loc) · 3.33 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{
description = "calamity";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
gitignore.url = "github:hercules-ci/gitignore.nix";
gitignore.inputs.nixpkgs.follows = "nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
haskell-flake.url = "github:srid/haskell-flake";
check-flake.url = "github:srid/check-flake";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
flake-root.url = "github:srid/flake-root";
# req.url = "github:mrkkrp/req";
# req.flake = false;
};
outputs = inputs@{ self, nixpkgs, gitignore, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = nixpkgs.lib.systems.flakeExposed;
# systems = [ "x86_64-linux" ];
imports = [
inputs.haskell-flake.flakeModule
inputs.treefmt-nix.flakeModule
inputs.flake-root.flakeModule
inputs.check-flake.flakeModule
];
perSystem = { self', lib, config, pkgs, ... }: {
haskellProjects.default = {
#basePackages = pkgs.haskell.packages.ghc981;
packages = {
hashable.source = "1.4.6.0";
aeson.source = "2.2.3.0";
websockets.source = "0.13.0.0";
# type-errors.source = "0.2.0.2";
# websockets.source = "0.13.0.0";
# crypton-connection.source = "0.3.1";
# crypton-x509-system.source = "1.6.7";
# crypton-x509.source = "1.7.6";
# tls.source = "1.7.0";
# req.source = inputs.req;
# http-client-tls.source = "0.3.6.2";
};
settings = {
hashable.check = false;
aeson-optics.jailbreak = true;
type-errors.check = false;
ListLike.check = false;
di-core.check = false;
optics.check = false;
crypton-x509.check = false;
vector.check = false;
ghcid.check = false;
haskell-language-server.custom = with pkgs.haskell.lib.compose; lib.flip lib.pipe [
(disableCabalFlag "floskell")
(disableCabalFlag "ormolu")
# (drv: drv.override { hls-ormolu-plugin = null; })
# (drv: drv.override { hls-floskell-plugin = null; })
];
};
devShell = {
tools = hp: { ghcid = null; };
hoogle = false;
hlsCheck.enable = false;
};
autoWire = [ "packages" "apps" ];
};
treefmt.config = {
inherit (config.flake-root) projectRootFile;
package = pkgs.treefmt;
programs.ormolu.enable = true;
programs.nixpkgs-fmt.enable = true;
programs.cabal-fmt.enable = true;
# We use fourmolu
programs.ormolu.package = pkgs.haskellPackages.fourmolu;
settings.formatter.ormolu = {
options = [
"--ghc-opt"
"-XImportQualifiedPost"
];
};
};
packages.default = self'.packages.calamity;
devShells.default = pkgs.mkShell {
name = "calamity-devshell";
inputsFrom = [
config.haskellProjects.default.outputs.devShell
config.flake-root.devShell
config.treefmt.build.devShell
];
};
};
};
}