-
Notifications
You must be signed in to change notification settings - Fork 6
/
flake.nix
78 lines (74 loc) · 2.08 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
78
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
git-hooks-nix.url = "github:cachix/git-hooks.nix";
ig.url = "github:mitchellh/zig-overlay";
};
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.git-hooks-nix.flakeModule
];
systems = [
"x86_64-linux"
];
perSystem =
{ config, pkgs, ... }:
{
devShells.default = pkgs.mkShell {
nativeBuildInputs = [
pkgs.zls
pkgs.zig
config.pre-commit.settings.enabledPackages
];
shellHook = ''
${config.pre-commit.installationScript}
echo 1>&2 "Welcome to the development shell!"
'';
};
pre-commit = {
settings = {
default_stages = [
"pre-commit"
"pre-push"
];
hooks = {
actionlint.enable = true;
typos = {
excludes = [
".*\.txt"
];
enable = true;
settings.configuration = ''
[default]
extend-ignore-identifiers-re = [
"tpub",
"xpub",
"zpub",
"tpub",
"tprv",
]
'';
};
markdownlint = {
enable = true;
settings.configuration = {
MD001 = false;
MD013 = false;
};
};
zigfmt = {
enable = true;
name = "zig-fmt";
files = "\\.zig$";
entry = "${pkgs.zig}/bin/zig fmt --check";
};
};
};
};
};
};
}