Full rewrite of devshell

migrates pre-commit to cachix's pre-commit-hooks

adds a ton of new hooks:
- check-added-large-files
- check-case-conflicts
- check-json
- check-merge-conflicts
- detect-private-keys
- fmt-check
- nil
- no-commit-to-branch
- statix (disabled for now)

migrates devshell to new devshells, set up modularly to have separate
functionality for sops, pre-commit-hooks, and our custom packages

Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
2024-05-19 23:32:52 -04:00
committed by Alice Huston
parent db7aeb7f03
commit 4015daea0a
4 changed files with 175 additions and 36 deletions

40
shell.nix Normal file
View File

@ -0,0 +1,40 @@
{
forEachSystem,
nixpkgs,
checks,
sops-nix,
...
}:
forEachSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
pre-commit = pkgs.mkShell {
inherit (checks.${system}.pre-commit-check) shellHook;
buildInputs = checks.${system}.pre-commit-check.enabledPackages;
};
sops = pkgs.mkShell {
sopsPGPKeyDirs = [ "./keys" ];
packages = [
pkgs.sops
sops-nix.packages.${system}.sops-import-keys-hook
];
};
rad-dev = pkgs.mkShell {
packages = with pkgs; [
deadnix
pre-commit
];
};
in
{
default = pkgs.mkShell {
inputsFrom = [
pre-commit
rad-dev
sops
];
};
}
)