summaryrefslogtreecommitdiff
path: root/parts/dev.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2023-09-03 15:13:58 -0400
committerseth <[email protected]>2023-09-03 15:18:59 -0400
commitfe850b69bc85e8196e09db6f62dfa6ef7cd015e4 (patch)
treeeeec227b5d142148ac6219d664c2d531d7b3e024 /parts/dev.nix
parent1fb6e8fc465e89347d4a14b8a2e36d2380b059bf (diff)
flake: refactor a little
Diffstat (limited to 'parts/dev.nix')
-rw-r--r--parts/dev.nix30
1 files changed, 14 insertions, 16 deletions
diff --git a/parts/dev.nix b/parts/dev.nix
index 246789a..fbd319b 100644
--- a/parts/dev.nix
+++ b/parts/dev.nix
@@ -4,12 +4,23 @@
...
}: {
perSystem = {
+ config,
craneLib,
pkgs,
system,
toolchain,
...
}: {
+ pre-commit = {
+ settings.hooks = {
+ actionlint.enable = true;
+ alejandra.enable = true;
+ deadnix.enable = true;
+ nil.enable = true;
+ statix.enable = true;
+ };
+ };
+
checks = let
inherit (craneLib) cargoAudit cargoClippy cleanCargoSource cargoFmt;
@@ -28,24 +39,11 @@
});
fmt = cargoFmt commonArgs;
-
- 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;
- };
- };
};
- devShells = let
- inherit (pkgs) mkShell;
- in {
- default = mkShell {
- inherit (self.checks.${system}.pre-commit-check) shellHook;
+ devShells = {
+ default = pkgs.mkShell {
+ shellHook = config.pre-commit.installationScript;
packages = with pkgs; [
actionlint
alejandra