feat(flake): add pre-commit to checks
This commit is contained in:
parent
ddb0484a2a
commit
5f8e62f8bf
22
flake.nix
22
flake.nix
|
@ -182,22 +182,12 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
checks = builtins.mapAttrs
|
|
||||||
(system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
|
|
||||||
|
|
||||||
} // flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system:
|
} // flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
|
||||||
src = ./.;
|
|
||||||
hooks = {
|
|
||||||
nixfmt.enable = true;
|
|
||||||
shellcheck.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in rec {
|
in rec {
|
||||||
formatter = pkgs.nixfmt;
|
formatter = pkgs.nixfmt;
|
||||||
|
|
||||||
|
@ -206,6 +196,16 @@
|
||||||
apps = { deconz = flake-utils.lib.mkApp { drv = packages.deconz; }; };
|
apps = { deconz = flake-utils.lib.mkApp { drv = packages.deconz; }; };
|
||||||
|
|
||||||
devShells.default =
|
devShells.default =
|
||||||
pkgs.mkShell { inherit (pre-commit-check) shellHook; };
|
pkgs.mkShell { inherit (checks.pre-commit) shellHook; };
|
||||||
|
|
||||||
|
checks = deploy-rs.lib.${system}.deployChecks self.deploy // {
|
||||||
|
pre-commit = pre-commit-hooks.lib.${system}.run {
|
||||||
|
src = ./.;
|
||||||
|
hooks = {
|
||||||
|
nixfmt.enable = true;
|
||||||
|
shellcheck.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue