Split git config, add mac-specific file

This commit is contained in:
Sam W 2022-01-10 19:30:22 +00:00
parent 17b66b11fb
commit 6e6154210c
4 changed files with 48 additions and 40 deletions

View File

@ -56,44 +56,5 @@ in {
fzf.enable = true; fzf.enable = true;
# Tools
git = {
enable = true;
userName = "Sam Willcocks";
userEmail = "sam@wlcx.cc";
delta = { # Better diffs
enable = true;
options = { line-numbers = true; };
};
aliases = {
a = "add";
ap = "add -p";
c = "commit";
can = "commit --amend --no-edit";
cm = "commit -m";
co = "checkout";
d = "diff";
dc = "diff --cached";
l = "log";
lp = "log --patch";
r = "rebase";
rc = "rebase --continue";
ra = "rebase --autostash";
rai = "rebase --autostash --interactive";
st = "status";
gone = ''
! "git fetch -p && git for-each-ref --format '%(refname:short) %(upstream:track)' | a
wk '$2 == \"[gone]\" {print $1}' | xargs -r git branch -D"'';
};
extraConfig = {
branch.sort = "-committerdate";
log.showSignature = true;
push.default = "current";
include.path = "~/.gitconfig.local";
};
};
}; };
} }

40
home/git.nix Normal file
View File

@ -0,0 +1,40 @@
{ ... }: {
programs.git = {
enable = true;
userName = "Sam Willcocks";
userEmail = "sam@wlcx.cc";
delta = { # Better diffs
enable = true;
options = { line-numbers = true; };
};
aliases = {
a = "add";
ap = "add -p";
c = "commit";
can = "commit --amend --no-edit";
cm = "commit -m";
co = "checkout";
d = "diff";
dc = "diff --cached";
l = "log";
lp = "log --patch";
r = "rebase";
rc = "rebase --continue";
ra = "rebase --autostash";
rai = "rebase --autostash --interactive";
st = "status";
gone = ''
! "git fetch -p && git for-each-ref --format '%(refname:short) %(upstream:track)' | a
wk '$2 == \"[gone]\" {print $1}' | xargs -r git branch -D"'';
};
extraConfig = {
branch.sort = "-committerdate";
log.showSignature = true;
push.default = "current";
include.path = "~/.gitconfig.local";
};
};
}

7
home/macs.nix Normal file
View File

@ -0,0 +1,7 @@
{ ... }: {
home.sessionVariables = {
# Use secretive for SSH agent
"SSH_AUTH_SOCK" =
"/Users/$USERNAME/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh";
};
}

View File

@ -1 +1 @@
{ dev = { ... }: { imports = [ ./default.nix ]; }; } { dev = { ... }: { imports = [ ./default.nix ./git.nix ./macs.nix ]; }; }