-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
61 lines (58 loc) · 1.89 KB
/
flake.nix
File metadata and controls
61 lines (58 loc) · 1.89 KB
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
{
description = "hledger-importer";
inputs = {
haskellNix.url = "github:input-output-hk/haskell.nix";
nixpkgs.follows = "haskellNix/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
devshell.url = "github:numtide/devshell";
};
nixConfig = {
extra-substituters = [ "https://cache.iog.io" ];
extra-trusted-public-keys =
[ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
};
outputs = inputs@{ self, flake-utils, haskellNix, devshell, nixpkgs, ... }:
flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" ] (system:
let
overlays = [
haskellNix.overlay
(final: prev: {
hledger-importer = final.haskell-nix.project' {
src = ./.;
compiler-nix-name = "ghc966";
};
})
devshell.overlays.default
];
pkgs = import nixpkgs {
inherit system overlays;
inherit (haskellNix) config;
};
flake = pkgs.hledger-importer.flake { };
shellWithToml = tomls:
pkgs.hledger-importer.shellFor {
exactDeps = false;
withHoogle = true;
inputsFrom = [
(pkgs.devshell.mkShell {
name = "hledger-importer";
packages = with pkgs; [ libiconv pkg-config ];
imports =
map pkgs.devshell.importTOML ([ ./devshell.toml ] ++ tomls);
})
];
tools = {
cabal = "latest";
fourmolu = "latest";
hlint = "latest";
cabal-fmt = "latest";
haskell-language-server = "latest";
};
};
in flake // {
packages = {
default = flake.packages."hledger-importer:exe:hledger-importer-exe";
};
devShells = { default = shellWithToml [ ]; };
});
}