Simplify: Git hooks via nix flake check (no systemd, no activation, deleted module)
This commit is contained in:
@@ -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"
|
||||
'';
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user