-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
formatter.nix
68 lines (67 loc) · 1.94 KB
/
formatter.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
{
perSystem =
{ pkgs, ... }:
{
treefmt = {
projectRootFile = "flake.nix";
settings.global.excludes = [
"*/nixos-vars.json"
"*/secrets.yaml"
"*.lock"
".gitignore"
"modules/nixos-wiki/favicon.ico"
"modules/nixos-wiki/nixos.png"
"modules/nixos-wiki/robots.txt"
"oauth-permissions.png"
"targets/nixos-wiki.nixos.org/secrets/*"
];
programs.hclfmt.enable = true;
programs.nixfmt.enable = true;
programs.nixfmt.package = pkgs.nixfmt-rfc-style;
programs.deadnix.enable = true;
programs.ruff.format = true;
programs.ruff.check = true;
programs.shfmt.enable = true;
programs.yamlfmt.enable = true;
settings.formatter.shfmt.includes = [
"*.envrc"
"*.envrc.private-template"
];
programs.shellcheck.enable = true;
programs.deno.enable = !pkgs.deno.meta.broken;
};
packages = {
default = pkgs.mkShell {
packages =
let
convert2Tofu =
provider:
provider.override (prev: {
homepage = builtins.replaceStrings [ "registry.terraform.io/providers" ] [
"registry.opentofu.org"
] prev.homepage;
});
in
[
pkgs.bashInteractive
pkgs.sops
(pkgs.opentofu.withPlugins (
p:
builtins.map convert2Tofu [
p.hcloud
p.null
p.external
p.local
]
))
];
};
} // (import ./checks/linkcheck/pkgs { inherit pkgs; });
devShells.linkcheck = pkgs.mkShell {
packages = [
pkgs.lychee
(pkgs.python3.withPackages (pypkgs: [ pypkgs.lxml ]))
];
};
};
}