git.nix 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. { pkgs, ... }:
  2. {
  3. home.packages = [ pkgs.git pkgs.git-crypt ];
  4. programs.git = {
  5. enable = true;
  6. userName = "Thomas Stachl";
  7. userEmail = "[email protected]";
  8. signing = {
  9. gpgPath = "${pkgs.gnupg}/bin/gpg";
  10. key = "ED5EAAA8E895B23A";
  11. signByDefault = true;
  12. };
  13. aliases = {
  14. b = "branch";
  15. bc = "checkout -b";
  16. bl = "branch -v";
  17. bL = "branch -av";
  18. bx = "branch -d";
  19. bX = "branch -D";
  20. bm = "branch -m";
  21. bM = "branch -M";
  22. bs = "show-branch";
  23. bS = "show-branch -a";
  24. co = "checkout";
  25. co0 = "checkout HEAD --";
  26. f = "fetch";
  27. fm = "pull";
  28. fo = "fetch origin";
  29. m = "merge";
  30. mom = "merge origin/master";
  31. p = "push";
  32. pa = "push --all";
  33. pt = "push --tags";
  34. r = "rebase";
  35. ra = "rebase --abort";
  36. rc = "rebase --continue";
  37. ri = "rebase --interactive";
  38. rs = "rebase --skip";
  39. rom = "rebase origin/master";
  40. c = "commit -v";
  41. ca = "commit --all -v";
  42. cm = "commit --message";
  43. cam = "commit --all --message";
  44. camend = "commit --amend --reuse-message HEAD";
  45. cundo = "reset --soft 'HEAD^'";
  46. cp = "cherry-pick";
  47. d = "diff # Diff working dir to index";
  48. ds = "diff --staged # Diff index to HEAD";
  49. dc = "diff --staged # Diff index to HEAD";
  50. dh = "diff HEAD # Diff working dir and index to HEAD";
  51. hub = "browse";
  52. hubd = "compare";
  53. s = "status";
  54. a = "add";
  55. ia = "add";
  56. ir = "reset";
  57. l = "log --topo-order --pretty=format:'%C(yellow)%h %C(cyan)%cn %C(blue)%cr%C(reset) %s'";
  58. ls = "log --topo-order --stat --pretty=format:'%C(bold)%C(yellow)Commit:%C(reset) %C(yellow)%H%C(red)%d%n%C(bold)%C(yellow)Author:%C(reset) %C(cyan)%an <%ae>%n%C(bold)%C(yellow)Date:%C(reset) %C(blue)%ai (%ar)%C(reset)%n%+B'";
  59. ld = "log --topo-order --stat --patch --full-diff --pretty=format:'%C(bold)%C(yellow)Commit:%C(reset) %C(yellow)%H%C(red)%d%n%C(bold)%C(yellow)Author:%C(reset) %C(cyan)%an <%ae>%n%C(bold)%C(yellow)Date:%C(reset) %C(blue)%ai (%ar)%C(reset)%n%+B'";
  60. lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
  61. lga = "log --topo-order --all --graph --pretty=format:'%C(yellow)%h %C(cyan)%cn%C(reset) %s %C(red)%d%C(reset)%n'";
  62. lm = "log --topo-order --pretty=format:'%s'";
  63. lh = "shortlog --summary --numbered";
  64. llf = "fsck --lost-found";
  65. lg1 = "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all";
  66. lg2 = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all";
  67. re = "remote";
  68. rel = "remote --verbose";
  69. rea = "remote add";
  70. rex = "remote rm";
  71. rem = "remote rename";
  72. };
  73. extraConfig = {
  74. core = {
  75. editor = "vim";
  76. pager = "less -FRSX";
  77. whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol";
  78. };
  79. color = {
  80. grep = "always";
  81. pager = "true";
  82. showbranch = "auto";
  83. ui = "always";
  84. interactive = {
  85. error = "red bold";
  86. };
  87. branch = {
  88. current = "yellow reverse";
  89. local = "yellow";
  90. remote = "green";
  91. };
  92. diff = {
  93. meta = "yellow";
  94. frag = "magenta";
  95. old = "red";
  96. new = "green";
  97. whitespace = "white reverse";
  98. };
  99. status = {
  100. added = "yellow";
  101. changed = "green";
  102. untracked = "cyan";
  103. branch = "magenta";
  104. };
  105. };
  106. diff.tool = "vimdiff";
  107. difftool.prompt = "false";
  108. merge.tool = "vimdiff";
  109. push.default = "matching";
  110. pull.rebase = "false";
  111. init.defaultBranch = "master";
  112. url = {
  113. "[email protected]:" = {
  114. insteadOf = "github:";
  115. };
  116. };
  117. branch = {
  118. master = {
  119. remote = "origin";
  120. merge = "refs/head/master";
  121. };
  122. };
  123. };
  124. };
  125. }
  126. # [filter "lfs"]
  127. # clean = git-lfs clean -- %f
  128. # smudge = git-lfs smudge -- %f
  129. # process = git-lfs filter-process
  130. # required = true