From d78f9fdf354b4efff2a514ace75359a68047319c Mon Sep 17 00:00:00 2001 From: Alexandre LUCAZEAU Date: Sun, 23 Jul 2023 11:38:03 +0200 Subject: [PATCH] UPGRADE git config by adding alias --- modules/git.nix | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 modules/git.nix diff --git a/modules/git.nix b/modules/git.nix new file mode 100644 index 0000000..288575a --- /dev/null +++ b/modules/git.nix @@ -0,0 +1,61 @@ +{ config, pkgs, ... }: +{ + programs.git = { + enable = true; + userEmail = "alexandre@dri.fr"; + userName = "Alexandre LUCAZEAU"; + aliases = { + ignore = "!gi() { curl -sL https://www.toptal.com/developers/gitignore/api/$@ ;}; gi"; + aa = "add --all"; + b = "branch -v"; + bd = "branch -d"; + bD = "branch -D"; + br = "branch"; + ci = "commit"; + cim = "commit -m"; + cima = "commit -am"; + clr = "rm -r --cached"; + co = "checkout"; + cp = "cherry-pick -x"; + d = "diff -w"; + dc = "diff --cached"; + nb = "checkout -b"; + oups = "commit --amend --no-edit"; + r = "remote -v"; + rh = "reset --hard"; + st = "status -sb"; + t = "tag -l"; + unstage = "reset HEAD"; + uncommit = "reset --soft HEAD^"; + pushfl = "push --force-with-lease"; + lg = "lg1"; + lg1 = "lg1-specific --all"; + lg2 = "lg2-specific --all"; + lg3 = "lg3-specific --all"; + }; + extraConfig = { + "color" = { + "ui" = true; + }; + "init" = { + defaultBranch = "main"; + }; + "color \"diff-highlight\"" = { + oldNormal = "red bold"; + oldHighlight = "red bold 52"; + newNormal = "green bold"; + newHighlight = "green bold 22"; + }; + "color \"diff\"" = { + meta = 11; + frag = "magenta bold"; + commit = "yellow bold"; + old = "red bold"; + new = "green bold"; + whitespace = "red reverse"; + }; + }; + signing.key = "3C8ADB07A8217BD3"; + signing.signByDefault = false; + }; +}