fork/home-manager
git clone https://git.julia.blue/fork/home-manager
340ec22f
master
1{ pkgs , ...} : 2 3{ 4programs . git = { 5enable = true ; 6hooks = { pre-commit = ./git-pre-commit-hook.sh ; }; 7}; 8 9nmt . script = '' 10function getGitConfig() { 11${ pkgs . gitMinimal } /bin/git config \ 12--file $ TESTED /home-files/.config/git/config \ 13--get $ 1 14} 15 16assertFileExists home-files/.config/git/config 17hookPath = $( getGitConfig core.hooksPath) 18assertLinkExists $ hookPath /pre-commit 19 20actual =" $( readlink " $ hookPath /pre-commit" ) " 21expected =" ${ ./git-pre-commit-hook.sh } " 22if [[ $ actual != $ expected ]]; then 23fail " Symlink $ hookPath /pre-commit should point to $ expected via the Nix store, but it actually points to $ actual ." 24fi 25'' ; 26}