-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
55 lines (55 loc) · 1.56 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ {
nixpkgs,
flake-parts,
treefmt-nix,
self,
}:
flake-parts.lib.mkFlake {
inherit inputs;
} {
imports = [inputs.treefmt-nix.flakeModule];
systems = ["x86_64-linux"];
flake.overlays.default = final-haskell: prev-haskell: {
sentencepiece-haskell = final-haskell.callCabal2nix "sentencepiece-haskell" ./. {};
};
perSystem = {
system,
pkgs,
config,
lib,
...
}: {
treefmt.config = {
projectRootFile = "flake.nix";
programs.ormolu.enable = true;
programs.alejandra.enable = true;
programs.cabal-fmt.enable = true;
programs.hlint.enable = true;
};
packages.default = pkgs.haskellPackages.callCabal2nix "sentencepiece-haskell" ./. {};
devShells.default = pkgs.haskellPackages.shellFor {
packages = ps: [
(ps.callCabal2nix "sentencepiece-haskell" ./. {})
];
inputsFrom = [
config.treefmt.build.devShell
];
buildInputs = with pkgs; [
cabal-install
haskell-language-server
nil
sentencepiece
];
LD_LIBRARY_PATH = lib.makeLibraryPath [pkgs.sentencepiece];
withHoogle = true;
};
};
};
}