summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <[email protected]>2023-08-17 19:12:30 -0400
committerseth <[email protected]>2023-08-17 19:12:30 -0400
commit583d7328baa423155c3c6fc250d8a19e81d10e88 (patch)
tree9b574aec3149c6c142cc208a3f0da4357dd25de1
parent122f5a3452661ace85e93ae6c6fb2715e678f411 (diff)
parts/dev: use pre-commit flake module
-rw-r--r--flake.nix12
-rw-r--r--parts/dev.nix32
2 files changed, 25 insertions, 19 deletions
diff --git a/flake.nix b/flake.nix
index 76c116f..f07881a 100644
--- a/flake.nix
+++ b/flake.nix
@@ -112,15 +112,21 @@
};
};
- outputs = inputs:
- inputs.flake-parts.lib.mkFlake
+ outputs = {
+ flake-parts,
+ getchoo,
+ pre-commit-hooks,
+ ...
+ } @ inputs:
+ flake-parts.lib.mkFlake
{inherit inputs;}
{
imports = [
./hosts
./parts
./users
- inputs.getchoo.flakeModules.homeConfigurations
+ getchoo.flakeModules.homeConfigurations
+ pre-commit-hooks.flakeModule
];
};
}
diff --git a/parts/dev.nix b/parts/dev.nix
index c0b5490..200f42d 100644
--- a/parts/dev.nix
+++ b/parts/dev.nix
@@ -1,41 +1,41 @@
{
inputs,
- self,
+ lib,
...
-}: {
+}: let
+ inherit (inputs) ragenix;
+in {
perSystem = {
+ config,
pkgs,
system,
...
}: {
- checks = {
- pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
- src = self;
- hooks = {
- actionlint.enable = true;
- alejandra.enable = true;
- deadnix.enable = true;
- nil.enable = true;
- statix.enable = true;
- stylua.enable = true;
- };
+ pre-commit = {
+ settings.hooks = {
+ actionlint.enable = true;
+ alejandra.enable = true;
+ deadnix.enable = true;
+ nil.enable = true;
+ statix.enable = true;
+ stylua.enable = true;
};
};
devShells = {
default = pkgs.mkShell {
- inherit (self.checks.${system}.pre-commit-check) shellHook;
+ shellHook = config.pre-commit.installationScript;
packages = with pkgs;
[
actionlint
alejandra
deadnix
just
- inputs.ragenix.packages.${system}.ragenix
+ ragenix.packages.${system}.ragenix
statix
stylua
]
- ++ lib.optional (system == "x86_64-linux") deploy-rs;
+ ++ lib.optional (system == "x86_64-linux") pkgs.deploy-rs;
};
};