This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
nixos-config/home-manager/git.nix

72 lines
2.0 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, user, ... }:
{
programs = {
git = {
enable = true;
extraConfig = {
2022-09-28 05:58:06 +00:00
core.editor = "nvim";
2022-09-28 05:58:06 +00:00
diff.external = "difft --background light";
diff.tool = "difftastic";
diff.ignoreSubmodules = "none";
2022-09-28 05:58:06 +00:00
difftool.difftastic.cmd = "difft --background light \"$LOCAL\" \"$REMOTE\"";
difftool.prompt = false;
fetch.writeCommitGraph = true;
fetch.recurseSubmodules = true;
2022-09-28 05:58:06 +00:00
format.pretty = "format:%C(yellow)%h %Cblue%>(12)%ad %C(red)%G? %Cgreen%<(7,trunc)%aN%Cred%d %Creset%s";
2022-09-28 05:58:06 +00:00
init.defaultBranch = "main";
2022-09-28 05:58:06 +00:00
log.date = "relative";
2022-09-28 05:58:06 +00:00
merge.ff = false;
2022-09-28 05:58:06 +00:00
merge.tool = "nvim";
mergetool.nvim.cmd = "nvim -f -c \"Gdiffsplit!\" \"$MERGED\"";
mergetool.prompt = false;
pager.difftool = true;
pull.rebase = true;
2022-09-28 05:58:06 +00:00
push.recurseSubmodules = "on-demand";
rebase.autostash = true;
2022-09-28 05:58:06 +00:00
rerere.enabled = true;
status.submoduleSummary = true;
submodule.recurse = true;
2022-09-28 05:58:06 +00:00
user.private.email = "mandlm@molez.net";
user.private.name = "Michael Mandl";
user.private.signingkey = "4AA25D647AA54CC7";
2022-09-13 06:19:59 +00:00
2022-09-28 05:58:06 +00:00
user.swp.email = "mandl@vi-bim.de";
user.swp.name = "Michael Mandl";
user.swp.signingkey = "4E60F44227F611B4";
worktree.guessRemote = true;
};
aliases = {
2022-07-11 06:37:12 +00:00
identity = ''! git config user.name "$(git config user.$1.name)"; git config user.email "$(git config user.$1.email)"; git config user.signingkey "$(git config user.$1.signingkey)"; git config commit.gpgsign "true"; : '';
clone-worktree = ''! mkdir $2; git clone $1 $2/.base; BRANCH=`git -C $2/.base symbolic-ref --short HEAD`; echo "branch is $BRANCH"; git -C $2/.base checkout --detach HEAD; git -C $2/.base worktree add ../$BRANCH; :'';
2023-03-15 07:50:03 +00:00
graph = "log --graph --all --max-count 32";
};
ignores = [
".env"
".direnv"
"*.swp"
];
};
};
}