-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
58 lines (48 loc) · 1.64 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
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let
name = "git-pair";
pkgs = nixpkgs.legacyPackages.${system};
inherit (nixpkgs.lib) composeManyExtensions;
inherit (pkgs.haskell.lib) packageSourceOverrides justStaticExecutables;
inherit (flake-utils.lib) mkApp;
hspkgs = pkgs.haskellPackages.extend (composeManyExtensions [
(self: super: {
${name} = self.callCabal2nix name ./. {};
})
# (packageSourceOverrides {
# ${name} = ./.;
# })
]);
in
{
# inherit pkgs hspkgs; # convenient for debugging sometimes
packages = {
${name} = justStaticExecutables hspkgs.${name};
default = self.packages.${system}.${name};
};
apps = {
${name} = mkApp { drv = self.packages.${system}.${name}; };
default = self.apps.${system}.${name};
};
devShells.default = hspkgs.shellFor {
packages = p: [
p.${name}
];
# exactDeps = false; # work around https://github.com/input-output-hk/haskell.nix/issues/839
buildInputs = [
pkgs.cabal-install
hspkgs.haskell-language-server
hspkgs.ghcid
hspkgs.hlint
hspkgs.ormolu
pkgs.nixpkgs-fmt
hspkgs.cabal-fmt
];
};
});
}