summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2021-01-05 15:14:36 -0500
committerBen Sima <ben@bsima.me>2021-01-05 15:14:36 -0500
commitb4728c9b8fd362dd6efb8d0e57a3749a8a2e52ba (patch)
tree6ff7ba4ca0f2a36bc8a68d99ddb772390a945d35
parent78d6537a2bd8a3c8bbb467bb6da0b0c7d3dfcc05 (diff)
Organize my git nix config/aliases better
-rw-r--r--darwin.nix37
-rw-r--r--lib/common.nix37
-rw-r--r--linux.nix37
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;
};