-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
50 lines (49 loc) · 1.74 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
# TODO
# * better devshell name overriding. clumsy because we can't access the
# derivation being used (because it's auto-grabbed). really just wanna change
# `ghc-shell-for` to `ghcXY` and keep the `-${pname}-${version}`!
# * honestly maybe I move away from haskell-flake...? it's weird
{
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}-generic-data-functions";
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-generic-data-functions;
devShells.default = self'.devShells.ghc96;
haskellProjects.ghc98 = {
basePackages = pkgs.haskell.packages.ghc98;
devShell = nondevDevShell "ghc98";
};
haskellProjects.ghc96 = {
basePackages = pkgs.haskell.packages.ghc96;
devShell.mkShellArgs.name = "ghc96-generic-data-functions";
};
haskellProjects.ghc94 = {
basePackages = pkgs.haskell.packages.ghc94;
devShell = nondevDevShell "ghc94";
};
haskellProjects.ghc92 = {
basePackages = pkgs.haskell.packages.ghc92;
devShell = nondevDevShell "ghc92";
};
};
};
}