-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
127 lines (114 loc) · 3.51 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
{
inputs = {
nixpkgs = {
type = "github";
owner = "nixos";
repo = "nixpkgs";
ref = "nixos-24.11";
};
nixpkgs-haskell-updates = {
type = "github";
owner = "nixos";
repo = "nixpkgs";
ref = "haskell-updates";
};
stacklock2nix = {
type = "github";
owner = "cdepillabout";
repo = "stacklock2nix";
};
pgp-wordlist = {
type = "github";
owner = "quchen";
repo = "pgp-wordlist";
flake = false;
};
};
outputs =
{
self,
nixpkgs,
nixpkgs-haskell-updates,
pgp-wordlist,
stacklock2nix,
}:
let
supportedSystems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
nixpkgsFor = forAllSystems (
system:
nixpkgs-haskell-updates.legacyPackages.${system}.appendOverlays [
stacklock2nix.overlay
self.overlays.default
]
);
in
{
# All packages provided by this flake
packages = forAllSystems (system: rec {
default = stack-lint-extra-deps;
stack-lint-extra-deps = nixpkgsFor.${system}.stack-lint-extra-deps;
});
checks = forAllSystems (
system:
let
pkgs = nixpkgsFor.${system};
in
rec {
sled-version = pkgs.testers.testVersion {
package = pkgs.stack-lint-extra-deps;
};
}
);
overlays.default = final: prev: {
stack-lint-extra-deps-stacklock = final.stacklock2nix {
stackYaml = ./stack.yaml;
# GHC version that matches stack.yaml
baseHaskellPkgSet = final.haskell.packages.ghc984;
# It is necessary to get this using a fetcher that doesn't unpack to
# preserve hash compatibility among case (in/)sensitive file systems.
all-cabal-hashes = final.fetchurl {
name = "all-cabal-hashes";
url = "https://github.com/commercialhaskell/all-cabal-hashes/archive/090338d05bcc279b2c99f0251943a62ef4e5f8ae.tar.gz";
sha256 = "sha256-DFxLXAXAfZjk+LIwezqpnQGo9GgwI6Fpua31aTOWI+I=";
};
additionalHaskellPkgSetOverrides =
hfinal: hprev:
# Workarounds for issues in tests
nixpkgs-haskell-updates.lib.genAttrs [
"ansi-wl-pprint"
"case-insensitive"
"integer-logarithms"
"lifted-base"
"prettyprinter"
"prettyprinter-compat-ansi-wl-pprint"
"primitive"
"quickcheck-instances"
"serialise"
"test-framework"
"uuid-types"
"yaml-marked"
] (name: final.haskell.lib.dontCheck hprev.${name});
additionalDevShellNativeBuildInputs = stacklockHaskellPkgSet: [
final.cabal-install
final.haskellPackages.fourmolu
nixpkgs.legacyPackages.${final.system}.stack
final.zlib
];
};
stack-lint-extra-deps = final.stack-lint-extra-deps-stacklock.pkgSet.stack-lint-extra-deps;
};
devShells = forAllSystems (system: {
default = nixpkgsFor.${system}.stack-lint-extra-deps-stacklock.devShell;
});
};
nixConfig = {
extra-substituters = [ "https://freckle.cachix.org" ];
extra-trusted-public-keys = [ "freckle.cachix.org-1:WnI1pZdwLf2vnP9Fx7OGbVSREqqi4HM2OhNjYmZ7odo=" ];
};
}