forked from rolehippie/coredns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
92 lines (81 loc) · 2.25 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{
description = "Description for the project";
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable";
};
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
};
devshell = {
url = "github:numtide/devshell";
};
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.pre-commit-hooks.flakeModule
inputs.devshell.flakeModule
];
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem = { config, self', inputs', pkgs, system, ... }:
let
python310 = pkgs.python310.withPackages (p: with p; [
pytest
pytest-testinfra
molecule
molecule-plugins
]);
in
{
pre-commit = {
check = {
enable = true;
};
settings = {
hooks = {
later = {
enable = true;
name = "ansible-later";
description = "Run ansible-later on all files in the project";
files = "\\.(yml|yaml)$";
entry = "${pkgs.ansible-later}/bin/ansible-later";
};
};
};
};
devshells = {
default = {
commands = [
{
name = "later";
help = "execute later command";
command = "${pkgs.ansible-later}/bin/ansible-later";
}
{
name = "doctor";
help = "execute doctor command";
command = "${pkgs.ansible-doctor}/bin/ansible-doctor -fv";
}
{
name = "testing";
help = "execute molecule command";
command = "${pkgs.molecule}/bin/molecule test --scenario-name default";
}
];
packages = with pkgs; [
ansible-doctor
ansible-lint
ansible-later
python310
];
};
};
};
};
}