From b4728c9b8fd362dd6efb8d0e57a3749a8a2e52ba Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Tue, 5 Jan 2021 15:14:36 -0500 Subject: Organize my git nix config/aliases better --- lib/common.nix | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/common.nix b/lib/common.nix index e49b0ee..dce2ed3 100644 --- a/lib/common.nix +++ b/lib/common.nix @@ -73,6 +73,37 @@ in defaultCommand = "rg --files"; }; + git = { + enable = true; + userName = "Ben Sima"; + userEmail = "ben@bsima.me"; + ignores = [ "*~" "*.swp" ]; + package = pkgs.gitAndTools.gitFull; + signing = { + key = gpgid; + signByDefault = false; + }; + aliases = { + authors = "shortlog -s -n"; + slog = "log --stat"; + glog = ''log --decorate --all --graph --pretty=format:"%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset" --abbrev-commit --date=relative''; + }; + extraConfig = { + push.default = "simple"; + pull.rebase = "true"; + commit.template = "${./git-commit-template}"; + sendemail = { + #smtpuser = "ben@bsima.me"; + #smtpserverport = 587; + smtpserver = "${homedir}/bin/sendmail"; + chainreplyto = false; + composeencoding = "UTF-8"; + annotate = "yes"; + }; + }; + + }; + tmux = { enable = true; extraConfig = builtins.readFile ./tmux; @@ -272,13 +303,11 @@ in bind '"\C-g\C-r": "$(_gr)\e\C-e\er"' ''; shellAliases = { - add = "git add --ignore-removal"; day = "date +%a"; ddate = "date +%Y.%m.%d"; dday = "date +%A"; e = "emacsclient -nw"; # emacs in a terminal f = "fossil"; - fetch = "git fetch"; g = "git"; ga = "git add -A"; gb = "git branch"; @@ -287,7 +316,6 @@ in gco = "git checkout"; gd = "git diff"; gl = "git pull --prune"; - glog = ''git log --decorate --all --graph --pretty=format:"%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset" --abbrev-commit --date=relative''; gp = "git push origin HEAD"; gs = "git status -sb"; hs = "home-manager switch"; @@ -312,8 +340,7 @@ in emacs = { enable = true; - # Disabling for spacemacs - #extraPackages = epkgs: import ./emacs-packages.nix { inherit epkgs; }; + extraPackages = epkgs: import ./emacs-packages.nix { inherit epkgs; }; }; }; } -- cgit v1.2.3