summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2023-03-06 10:06:40 -0500
committerseth <[email protected]>2023-03-06 10:07:00 -0500
commit08224d0cda2374648cfe4e8400f5f6643be06751 (patch)
tree434918a534eae39a2aa5b9505abbe269aee06e3d /flake.nix
parentbb057765034c9fa8b93d92218d2b0a2686e680de (diff)
feat(infra): add pre-commit hooks and devshell
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
index eebf6e8..b8b5c78 100644
--- a/flake.nix
+++ b/flake.nix
@@ -5,12 +5,19 @@
url = "github:nix-community/naersk";
inputs.nixpkgs.follows = "nixpkgs";
};
+ pre-commit-hooks = {
+ url = "github:cachix/pre-commit-hooks.nix";
+ inputs.nixpkgs.follows = "nixpkgs";
+ inputs.flake-utils.follows = "utils";
+ };
};
outputs = {
+ self,
nixpkgs,
utils,
naersk,
+ pre-commit-hooks,
...
}: let
supportedSystsems = with utils.lib.system; [
@@ -32,7 +39,27 @@
utils.lib.eachSystem supportedSystsems (system: let
pkgs = import nixpkgs {inherit system;};
in {
+ checks = {
+ pre-commit-check = pre-commit-hooks.lib.${system}.run {
+ src = ./.;
+ hooks = {
+ # formatting is taken care of by gh actions :)
+ deadnix.enable = true;
+ markdownlint.enable = true;
+ };
+ };
+ };
+
+ devShells.default = pkgs.mkShell {
+ inherit (self.checks.${system}.pre-commit-check) shellHook;
+ packages = with pkgs; [
+ nodePackages.markdownlint-cli
+ deadnix
+ ];
+ };
+
formatter = pkgs.alejandra;
+
packages = let
p = packageSet pkgs;
in