Add git-mit as a repository template
This commit is contained in:
parent
2b40ad76e8
commit
9a5413f1dc
1 changed files with 23 additions and 1 deletions
|
@ -1,4 +1,23 @@
|
||||||
{ pkgs, ... }: {
|
{ pkgs, ... }:
|
||||||
|
let gitTemplate = pkgs.stdenv.mkDerivation {
|
||||||
|
name = "git-template";
|
||||||
|
src = pkgs.writeFile "dummy" "";
|
||||||
|
nativeBuildInputs = with pkgs; with rust-binaries; [
|
||||||
|
git
|
||||||
|
mit-commit-msg
|
||||||
|
mit-pre-commit
|
||||||
|
mit-prepare-commit-msg
|
||||||
|
];
|
||||||
|
buildPhase = "true";
|
||||||
|
installPhase = ''
|
||||||
|
git init $out
|
||||||
|
ln -s $out/.git/hooks/commit-msg ${mit-commit-msg}/bin/mit-commit-msg
|
||||||
|
ln -s $out/.git/hooks/pre-commit ${mit-pre-commit}/bin/mit-pre-commit
|
||||||
|
ln -s $out/.git/hooks/prepare-commit-msg ${mit-prepare-commit-msg}/bin/mit-prepare-commit-msg
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.gitAndTools.gitFull;
|
package = pkgs.gitAndTools.gitFull;
|
||||||
|
@ -7,6 +26,9 @@
|
||||||
signing.key = "AB2BD8DAF2E37122";
|
signing.key = "AB2BD8DAF2E37122";
|
||||||
userEmail = "lotte@chir.rs";
|
userEmail = "lotte@chir.rs";
|
||||||
userName = "Charlotte 🦝 Delenk";
|
userName = "Charlotte 🦝 Delenk";
|
||||||
|
extraConfig = {
|
||||||
|
init.templatedir = "${gitTemplate}";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
home.packages = with pkgs.rust-binaries; [
|
home.packages = with pkgs.rust-binaries; [
|
||||||
git-mit
|
git-mit
|
||||||
|
|
Loading…
Reference in a new issue