-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
93 lines (88 loc) · 3.9 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
{
description = "Haskell 'kind-integer' and 'kind-rational' libraries";
inputs = {
flakety.url = "github:k0001/flakety";
nixpkgs.follows = "flakety/nixpkgs";
flake-parts.follows = "flakety/flake-parts";
};
outputs = inputs@{ ... }:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
flake.overlays.default = inputs.nixpkgs.lib.composeManyExtensions [
inputs.flakety.overlays.default
(final: prev: {
haskell = prev.haskell // {
packageOverrides = prev.lib.composeExtensions
(prev.haskell.packageOverrides or (_: _: { })) (hself: hsuper: {
kind-integer = hself.callPackage ./kind-integer { };
kind-rational = hself.callPackage ./kind-rational { };
});
};
})
];
systems = [ "x86_64-linux" ];
perSystem = { config, system, pkgs, ... }: {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ inputs.self.overlays.default ];
};
packages = {
default = pkgs.releaseTools.aggregate {
name = "every output from this flake";
constituents = [
config.devShells.ghc96
config.packages.kind-integer__ghc96
config.packages.kind-integer__ghc96.doc
config.packages.kind-integer__ghc96__sdist
config.packages.kind-integer__ghc96__sdistDoc
config.packages.kind-rational__ghc96
config.packages.kind-rational__ghc96.doc
config.packages.kind-rational__ghc96__sdist
config.packages.kind-rational__ghc96__sdistDoc
config.devShells.ghc98
config.packages.kind-integer__ghc98
config.packages.kind-integer__ghc98.doc
config.packages.kind-integer__ghc98__sdist
config.packages.kind-integer__ghc98__sdistDoc
config.packages.kind-rational__ghc98
config.packages.kind-rational__ghc98.doc
config.packages.kind-rational__ghc98__sdist
config.packages.kind-rational__ghc98__sdistDoc
];
};
kind-integer__ghc96 = pkgs.haskell.packages.ghc96.kind-integer;
kind-integer__ghc96__sdist =
pkgs.haskell.packages.ghc96.cabalSdist { src = ./kind-integer; };
kind-integer__ghc96__sdistDoc = pkgs.haskell.lib.documentationTarball
config.packages.kind-integer__ghc96;
kind-rational__ghc96 = pkgs.haskell.packages.ghc96.kind-rational;
kind-rational__ghc96__sdist =
pkgs.haskell.packages.ghc96.cabalSdist { src = ./kind-rational; };
kind-rational__ghc96__sdistDoc = pkgs.haskell.lib.documentationTarball
config.packages.kind-rational__ghc96;
kind-integer__ghc98 = pkgs.haskell.packages.ghc98.kind-integer;
kind-integer__ghc98__sdist =
pkgs.haskell.packages.ghc98.cabalSdist { src = ./kind-integer; };
kind-integer__ghc98__sdistDoc = pkgs.haskell.lib.documentationTarball
config.packages.kind-integer__ghc98;
kind-rational__ghc98 = pkgs.haskell.packages.ghc98.kind-rational;
kind-rational__ghc98__sdist =
pkgs.haskell.packages.ghc98.cabalSdist { src = ./kind-rational; };
kind-rational__ghc98__sdistDoc = pkgs.haskell.lib.documentationTarball
config.packages.kind-rational__ghc98;
};
devShells = let
mkShellFor = ghc:
ghc.shellFor {
packages = p: [ p.kind-integer p.kind-rational ];
withHoogle = true;
nativeBuildInputs =
[ pkgs.cabal-install pkgs.cabal2nix pkgs.ghcid ];
};
in {
default = config.devShells.ghc98;
ghc96 = mkShellFor pkgs.haskell.packages.ghc96;
ghc98 = mkShellFor pkgs.haskell.packages.ghc98;
};
};
};
}