-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
92 lines (81 loc) · 2.12 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
{
inputs = {
### Nixpkgs ###
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
### Flake / Project Inputs ###
flake-parts.url = "github:hercules-ci/flake-parts";
flake-root.url = "github:srid/flake-root";
mission-control.url = "github:Platonic-Systems/mission-control";
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
# inputs.flake-utils.inputs.systems.follows = "systems";
};
systems.url = "github:nix-systems/default";
treefmt = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
flake-parts,
flake-root,
mission-control,
pre-commit-hooks,
systems,
treefmt,
} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} ({
withSystem,
inputs,
...
}: {
systems = import systems;
imports = [
flake-root.flakeModule
mission-control.flakeModule
pre-commit-hooks.flakeModule
treefmt.flakeModule
];
perSystem = {
config,
self',
inputs',
pkgs,
system,
lib,
...
}: {
devShells.default = pkgs.mkShell {
inputsFrom = [
config.mission-control.devShell
config.pre-commit.devShell
config.treefmt.build.devShell
];
buildInputs = with pkgs; [
kubernetes-helm
];
};
mission-control.scripts = {
fmt = {
description = "Format the source tree";
exec = config.treefmt.build.wrapper;
category = "Dev Tools";
};
};
pre-commit = {
check.enable = true;
settings.hooks.treefmt.enable = true;
settings.settings.treefmt.package = config.treefmt.build.wrapper;
};
treefmt.config = {
inherit (config.flake-root) projectRootFile;
package = pkgs.treefmt;
programs.alejandra.enable = true;
};
formatter = config.treefmt.build.wrapper;
};
});
}