-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathflake.nix
48 lines (48 loc) · 1.6 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
haskell-flake.url = "github:srid/haskell-flake";
};
outputs = inputs:
let
# simple devshell for non-dev compilers: really just want `cabal repl`
nondevDevShell = compiler: {
mkShellArgs.name = "${compiler}-flatparse";
hoogle = false;
tools = _: {
hlint = null;
haskell-language-server = null;
ghcid = null;
};
};
in
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = inputs.nixpkgs.lib.systems.flakeExposed;
imports = [ inputs.haskell-flake.flakeModule ];
perSystem = { self', pkgs, config, ... }: {
packages.default = self'.packages.ghc96-flatparse;
devShells.default = self'.devShells.ghc96;
haskellProjects.ghc98 = {
# shouldn't work, pkgs aren't up to date and mine aren't 9.8 ready
basePackages = pkgs.haskell.packages.ghc98;
devShell = nondevDevShell "ghc98";
};
haskellProjects.ghc96 = {
basePackages = pkgs.haskell.packages.ghc96;
devShell.mkShellArgs.name = "ghc96-flatparse";
devShell.tools = _: {
haskell-language-server = null; # 2024-03-06: broken
};
};
haskellProjects.ghc94 = {
basePackages = pkgs.haskell.packages.ghc94;
devShell = nondevDevShell "ghc94";
};
haskellProjects.ghc92 = {
basePackages = pkgs.haskell.packages.ghc92;
devShell = nondevDevShell "ghc92";
};
};
};
}