-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
71 lines (59 loc) · 2.32 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
{
description = "Horses";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
compilerVersion = "ghc963";
# fix things
haskell = pkgs.haskell // {
packages = pkgs.haskell.packages // {
"${compilerVersion}" =
pkgs.haskell.packages."${compilerVersion}".override {
overrides = self: super: {
# On aarch64-darwin, this creates a cycle for some reason; didn't look too much into it.
ghcid = pkgs.haskell.lib.dontCheck (pkgs.haskell.lib.overrideCabal super.ghcid (drv: { enableSeparateBinOutput = false; }));
# has wrong version of unix-compat, so we ignore it
shelly = pkgs.haskell.lib.doJailbreak super.shelly;
# try and remove cycle
cabal-fmt = pkgs.haskell.lib.dontCheck (pkgs.haskell.lib.overrideCabal super.cabal-fmt (drv: {
enableSeparateBinOutput = false;
}));
# try and remove cycle
ormolu = pkgs.haskell.lib.dontCheck (pkgs.haskell.lib.overrideCabal super.ormolu (drv: {
enableSeparateBinOutput = false;
}));
};
};
};
};
haskellPackages = haskell.packages.${compilerVersion};
jailbreakUnbreak = pkg:
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
packageName = "horses";
in
{
# we're not interested in building with Nix, just using it for deps
packages.${system}.${packageName} = { };
defaultPackage = self.packages.${system}.${packageName};
devShell = pkgs.mkShell {
buildInputs = with haskellPackages; [
hlint
apply-refact
ormolu
# haskell-language-server # this simply does nothing atm
ghcid
cabal-fmt
cabal-install
ghc
pkgs.clang_14
pkgs.llvmPackages_14.llvm
];
inputsFrom = builtins.attrValues self.packages.${system};
};
});
}