nix machine / user configurations
at terra 1.9 kB view raw
1{ pkgs, ... }: 2let 3 name = "dawn"; 4 email = "90008@gaze.systems"; 5in 6{ 7 programs.git = { 8 enable = true; 9 includes = [ 10 { 11 contents = { 12 gpg.format = "ssh"; 13 commit.gpgsign = true; 14 user = { 15 inherit name email; 16 signingkey = builtins.readFile ../../../secrets/yusdacra.key.pub; 17 }; 18 }; 19 } 20 { 21 contents = { 22 23 pull.rebase = true; 24 diff.external = "${pkgs.difftastic}/bin/difft"; 25 alias = { 26 a = "add -p"; 27 co = "checkout"; 28 cob = "checkout -b"; 29 f = "fetch -p"; 30 c = "commit"; 31 ps = "push"; 32 pl = "pull"; 33 rb = "rebase"; 34 ba = "branch -a"; 35 bd = "branch -d"; 36 bD = "branch -D"; 37 d = "diff"; 38 dc = "diff --cached"; 39 ds = "diff --staged"; 40 rs = "restore"; 41 rss = "restore --staged"; 42 s = "status -sb"; 43 ss = "stash"; 44 ssp = "stash pop"; 45 ssl = "stash list"; 46 ssd = "stash drop"; 47 # reset 48 rsoft = "reset --soft"; 49 rhard = "reset --hard"; 50 rs1ft = "soft HEAD~1"; 51 rh1rd = "hard HEAD~1"; 52 # logging 53 l = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; 54 plog = "log --graph --pretty='format:%C(red)%d%C(reset) %C(yellow)%h%C(reset) %ar %C(green)%aN%C(reset) %s'"; 55 tlog = "log --stat --since='1 Day Ago' --graph --pretty=oneline --abbrev-commit --date=relative"; 56 rank = "shortlog -sn --no-merges"; 57 # delete merged branches 58 bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d"; 59 }; 60 }; 61 } 62 ]; 63 }; 64}