From 8f461f6ced6612639c8f84dd12c9e29e34d1f7dc Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Mon, 28 Oct 2024 16:08:07 +0100 Subject: [PATCH] Add formatting pre-commit hook --- .envrc | 1 + .gitignore | 2 ++ flake.nix | 1 + shell.nix | 14 ++++++++++++++ 4 files changed, 18 insertions(+) create mode 100644 .envrc create mode 100644 .gitignore create mode 100644 shell.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f9a759c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.direnv +.pre-commit-config.yaml diff --git a/flake.nix b/flake.nix index 8e7fbbd..119d849 100644 --- a/flake.nix +++ b/flake.nix @@ -52,5 +52,6 @@ ./scripts ./globals.nix ./formatter.nix + ./shell.nix ]; } diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..8156f5f --- /dev/null +++ b/shell.nix @@ -0,0 +1,14 @@ +{ + self, + flake-utils, + nixpkgs, + ... +}: +flake-utils.lib.eachDefaultSystem (system: let + pkgs = nixpkgs.legacyPackages.${system}; +in { + devShells.default = pkgs.mkShell { + inherit (self.checks.${system}.pre-commit-check) shellHook; + buildInputs = self.checks.${system}.pre-commit-check.enabledPackages; + }; +})