-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
70 lines (67 loc) · 2.02 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils/main";
flake-compat = {
url = "github:edolstra/flake-compat/master";
flake = false;
};
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
inputs.flake-compat.follows = "flake-compat";
};
};
description = "";
outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
let
overlay = se: su: {
haskellPackages = su.haskellPackages.override {
overrides = hse: _hsu: {
"indigo" = hse.callCabal2nix "indigo" ./. { };
};
};
indigo = se.haskell.lib.justStaticExecutables se.haskellPackages.indigo;
};
in
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ overlay ];
};
in
{
checks = {
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
hlint.enable = true;
nixpkgs-fmt.enable = true;
# nix-linter.enable = true;
# statix.enable = true;
fourmolu.enable = true;
# cabal-fmt.enable = true;
shellcheck.enable = true;
};
};
};
defaultPackage = pkgs.indigo;
devShell = pkgs.haskellPackages.shellFor {
packages = p: [ p."indigo" ];
buildInputs = [
pkgs.haskellPackages.haskell-language-server
pkgs.haskellPackages.cabal-install
pkgs.haskellPackages.ghcid
pkgs.haskellPackages.fourmolu
pkgs.haskellPackages.hlint
pkgs.wasmtime
pkgs.wabt
pkgs.wizer
];
withHoogle = false;
inherit (inputs.self.checks.${system}.pre-commit-check) shellHook;
};
});
}