From 89ae4c2ad7ea4812cfbbbcf606abc5fc35ab8e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 11 Nov 2025 13:04:06 +0800 Subject: [PATCH] vanadium: pre-commits --- nix/git-identities/hooks/cabal/pre-commit | 4 ++++ nix/git-identities/list.nix | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 nix/git-identities/hooks/cabal/pre-commit diff --git a/nix/git-identities/hooks/cabal/pre-commit b/nix/git-identities/hooks/cabal/pre-commit new file mode 100755 index 00000000..8d97c752 --- /dev/null +++ b/nix/git-identities/hooks/cabal/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +make style +make lint diff --git a/nix/git-identities/list.nix b/nix/git-identities/list.nix index 7df85864..b318462b 100644 --- a/nix/git-identities/list.nix +++ b/nix/git-identities/list.nix @@ -1,4 +1,7 @@ let + sources = import ../../npins; + lib = import (sources.nixpkgs + "/lib"); + haskellIdentity = { init.defaultBranch = "main"; user.name = "Léana Jiang"; @@ -16,6 +19,8 @@ let blameIgnore = { blame.ignoreRevsFile = ".git-blame-ignore-revs"; }; + + hooks = scriptsPath: { core.hooksPath = scriptsPath; }; in [ # Univ stuff @@ -49,6 +54,9 @@ in { url = "github.com"; path = "haskell/cabal.git"; - contents = blameIgnore; + contents = lib.mkMerge [ + blameIgnore + (hooks "${./hooks/cabal}") + ]; } ]