Simplify: Git hooks via nix flake check (no systemd, no activation, deleted module)

This commit is contained in:
2026-02-05 18:01:26 +01:00
parent 03baf67e79
commit 67d7313691
9 changed files with 214 additions and 145 deletions

View File

@@ -1,36 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
options.services.git-hooks = {
enable = lib.mkEnableOption "Install git hooks for Nix flake";
};
config = lib.mkIf config.services.git-hooks.enable {
system.activationScripts.git-hooks = lib.stringAfter [ "users" ] ''
echo "🪝 Installing git hooks..."
cd /home/h/nix
# Use nix flake check which properly evaluates and installs hooks
nix flake check 2>&1 || true
'';
environment.systemPackages = lib.singleton (
pkgs.writeShellApplication {
name = "install-git-hooks";
runtimeInputs = [ pkgs.git ];
text = ''
set -euo pipefail
echo "🪝 Installing git hooks..."
cd /home/h/nix
nix flake check || echo " Hook installation had issues"
echo " Done"
'';
}
);
};
}