hooks
This commit is contained in:
parent
ef7e64f2b1
commit
cc62f8a2b9
6 changed files with 198 additions and 12 deletions
45
flake.nix
45
flake.nix
|
@ -4,6 +4,8 @@
|
|||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
git-hooks.url = "github:cachix/git-hooks.nix";
|
||||
treefmt.url = "github:numtide/treefmt-nix";
|
||||
hardware.url = "github:NixOS/nixos-hardware";
|
||||
agenix.url = "github:ryantm/agenix";
|
||||
hxwrap.url = "github:lukaswrz/hxwrap";
|
||||
|
@ -12,9 +14,15 @@
|
|||
outputs = {
|
||||
nixpkgs,
|
||||
flake-parts,
|
||||
treefmt,
|
||||
...
|
||||
} @ inputs:
|
||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||
imports = [
|
||||
inputs.git-hooks.flakeModule
|
||||
inputs.treefmt.flakeModule
|
||||
];
|
||||
|
||||
systems = ["x86_64-linux" "aarch64-linux"];
|
||||
|
||||
flake = let
|
||||
|
@ -31,15 +39,44 @@
|
|||
};
|
||||
|
||||
perSystem = {
|
||||
inputs',
|
||||
config,
|
||||
pkgs,
|
||||
inputs',
|
||||
...
|
||||
}: {
|
||||
devShells.default = pkgs.mkShellNoCC {
|
||||
packages = [inputs'.agenix.packages.agenix];
|
||||
treefmt = ./treefmt.nix;
|
||||
|
||||
pre-commit = {
|
||||
check.enable = true;
|
||||
|
||||
settings = {
|
||||
hooks = {
|
||||
treefmt.enable = true;
|
||||
deadnix.enable = true;
|
||||
statix.enable = true;
|
||||
shellcheck = {
|
||||
enable = true;
|
||||
excludes = [
|
||||
"^\.envrc$"
|
||||
];
|
||||
};
|
||||
flake-checker.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
formatter = pkgs.alejandra;
|
||||
devShells.default = pkgs.mkShellNoCC {
|
||||
inherit (config.pre-commit.devShell) shellHook;
|
||||
|
||||
inputsFrom = [
|
||||
config.pre-commit.devShell
|
||||
config.treefmt.build.devShell
|
||||
];
|
||||
|
||||
packages = [
|
||||
inputs'.agenix.packages.agenix
|
||||
];
|
||||
};
|
||||
|
||||
packages.disk = pkgs.writeShellApplication {
|
||||
name = "disk";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue