forked from Fediversity/Fediversity
pass in description fix syntax configure proxmox provider typo add doc comment in existing modules add comment allow insecure proxmox connection for use in dev wip proxmox progress use service configurations moved to machine-independent location wire settings directly without option block terraform adjust cwd try tf on null input update .envrc.sample with sample proxmox credentials
61 lines
1.4 KiB
Nix
61 lines
1.4 KiB
Nix
{
|
|
system ? builtins.currentSystem,
|
|
sources ? import ./npins,
|
|
pkgs ? import sources.nixpkgs { inherit system; },
|
|
}:
|
|
let
|
|
inherit (sources)
|
|
nixpkgs
|
|
git-hooks
|
|
gitignore
|
|
;
|
|
inherit (pkgs) lib;
|
|
pre-commit-check =
|
|
(import "${git-hooks}/nix" {
|
|
inherit nixpkgs system;
|
|
gitignore-nix-src = {
|
|
lib = import gitignore { inherit lib; };
|
|
};
|
|
}).run
|
|
{
|
|
src = ./.;
|
|
hooks =
|
|
let
|
|
## Add a directory here if pre-commit hooks shouldn't apply to it.
|
|
optout = [
|
|
"npins"
|
|
".terraform"
|
|
];
|
|
excludes = map (dir: "^${dir}/") optout;
|
|
addExcludes = lib.mapAttrs (_: c: c // { inherit excludes; });
|
|
in
|
|
addExcludes {
|
|
nixfmt-rfc-style.enable = true;
|
|
deadnix.enable = true;
|
|
trim-trailing-whitespace.enable = true;
|
|
shellcheck.enable = true;
|
|
};
|
|
};
|
|
in
|
|
{
|
|
# shell for testing TF directly
|
|
shell = pkgs.mkShellNoCC {
|
|
inherit (pre-commit-check) shellHook;
|
|
buildInputs = pre-commit-check.enabledPackages;
|
|
packages = [
|
|
pkgs.nixfmt-rfc-style
|
|
];
|
|
};
|
|
|
|
tests = {
|
|
inherit pre-commit-check;
|
|
};
|
|
|
|
# re-export inputs so they can be overridden granularly
|
|
# (they can't be accessed from the outside any other way)
|
|
inherit
|
|
sources
|
|
system
|
|
pkgs
|
|
;
|
|
}
|