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 --- darwin.nix | 37 +------------------------------------ lib/common.nix | 37 ++++++++++++++++++++++++++++++++----- linux.nix | 37 ------------------------------------- 3 files changed, 33 insertions(+), 78 deletions(-) diff --git a/darwin.nix b/darwin.nix index 4dc9676..c221e9e 100644 --- a/darwin.nix +++ b/darwin.nix @@ -2,8 +2,6 @@ let homedir = builtins.getEnv "HOME"; - gitCommitTemplate = ./lib/git-commit-template; - gpgid = "D09299626FA78AF8"; haskellOverlay = self: super: { haskellPackages = super.haskellPackages.override (old: { overrides = self: super: { @@ -33,35 +31,6 @@ in programs = { - 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"; - }; - extraConfig = '' - [push] - default = simple - - [commit] - template = ${gitCommitTemplate} - - [sendemail] - smtpuser = ben@bsima.me - smptserverport = 587 - smptserver = mail.bsima.me - chainreplyto = false - composeencoding = UTF-8 - ''; - }; - # Doesnt' work bc clang can't compile it?? #qutebrowser = { # enable = true; @@ -70,9 +39,5 @@ in # }; #}; - emacs = { - enable = true; - extraPackages = epkgs: import ./lib/emacs-packages.nix { inherit epkgs; }; - }; - }; + }; } 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; }; }; }; } diff --git a/linux.nix b/linux.nix index 48f73df..446957c 100644 --- a/linux.nix +++ b/linux.nix @@ -392,39 +392,6 @@ in }; programs = { - 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"; - }; - extraConfig = { - push.default = "simple"; - pull.rebase = "true"; - commit.template = "${./lib/git-commit-template}"; - sendemail = { - #smtpuser = "ben@bsima.me"; - #smtpserverport = 587; - smtpserver = "${homedir}/bin/sendmail"; - chainreplyto = false; - composeencoding = "UTF-8"; - annotate = "yes"; - }; - }; - }; - - emacs = { - enable = true; - extraPackages = epkgs: import ./lib/emacs-packages.nix { inherit epkgs; }; - }; - qutebrowser = { enable = true; settings = { @@ -436,10 +403,6 @@ in }; }; - firefox = { - enable = true; - }; - chromium = { enable = true; }; -- cgit v1.2.3