-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathflake.nix
77 lines (73 loc) · 2.16 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
{
description = "Ema project";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
haskell-flake.url = "github:srid/haskell-flake";
fourmolu-nix.url = "github:jedimahdi/fourmolu-nix";
git-hooks.url = "github:cachix/git-hooks.nix";
git-hooks.flake = false;
emanote.url = "github:srid/emanote";
};
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = nixpkgs.lib.systems.flakeExposed;
imports = [
inputs.haskell-flake.flakeModule
inputs.fourmolu-nix.flakeModule
(inputs.git-hooks + /flake-module.nix)
inputs.emanote.flakeModule
];
perSystem = { config, pkgs, ... }: {
# This attr is provided by https://github.com/srid/haskell-flake
haskellProjects.default = {
autoWire = [ "packages" "checks" ];
};
devShells.default = pkgs.mkShell {
name = "ema-shell";
inputsFrom = [
config.pre-commit.devShell
config.haskellProjects.default.outputs.devShell
];
packages = with pkgs; [
nixd
just
];
};
pre-commit.settings = {
hooks = {
nixpkgs-fmt.enable = true;
cabal-fmt.enable = true;
fourmolu = {
enable = true;
package = config.fourmolu.wrapper;
};
};
};
fourmolu.settings = {
indentation = 2;
comma-style = "leading";
record-brace-space = true;
indent-wheres = true;
import-export-style = "diff-friendly";
respectful = true;
haddock-style = "multi-line";
newlines-between-decls = 1;
extensions = [ "ImportQualifiedPost" ];
};
emanote = {
sites = {
"docs" = {
layers = [
{
path = ./docs;
pathString = "./docs";
}
];
prettyUrls = true;
};
};
};
};
};
}