From 2599d2e49c141150ba848746cb32207eb3b48950 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Sat, 5 Jul 2025 20:30:31 +0800 Subject: [PATCH] feat(git-hooks): enable nixpkgs-fmt pre-commit hook --- .pre-commit-config.yaml | 1 + modules/flake-parts/git-hooks.nix | 7 +++++++ 2 files changed, 8 insertions(+) create mode 120000 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 120000 index 0000000..33d4794 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1 @@ +/nix/store/qh06700fhmh52lwrzswkvbk3g06br5rm-pre-commit-config.json \ No newline at end of file diff --git a/modules/flake-parts/git-hooks.nix b/modules/flake-parts/git-hooks.nix index 8ff3255..8341bf7 100644 --- a/modules/flake-parts/git-hooks.nix +++ b/modules/flake-parts/git-hooks.nix @@ -2,4 +2,11 @@ { # TODO: add to readme imports = [ inputs.git-hooks.flakeModule ]; + perSystem = psArgs: { + pre-commit.settings.hooks = { + nixpkgs-fmt.enable = true; + #TODO: add write-files + }; + make-shells.default.shellHook = psArgs.config.pre-commit.installationScript; + }; }