89 lines
2.5 KiB
Nix
89 lines
2.5 KiB
Nix
{ pkgs, ... }: {
|
|
home-manager.users.fhauser.programs.git = {
|
|
enable = true;
|
|
package = pkgs.gitAndTools.gitFull;
|
|
aliases = {
|
|
s = "status --short --branch";
|
|
a = "add --patch";
|
|
c = "commit --message";
|
|
l =
|
|
"log --color --graph --pretty=format:'%Cred%h%Creset - %C(bold)%s%Creset%C(yellow)%d%Creset %C(green)%an%Creset %C(cyan)%cr%Creset (S: %G?)' --abbrev-commit";
|
|
d = "diff";
|
|
|
|
fup = "commit --fixup";
|
|
fuprebase = "rebase --interactive --autosquash";
|
|
|
|
ignore = "update-index --skip-worktree";
|
|
unignore = "update-index --no-skip-worktree";
|
|
ignored = ''!git ls-files -v | grep "^S"'';
|
|
};
|
|
#delta = {
|
|
# enable = true;
|
|
# options = {
|
|
# side-by-side = "true";
|
|
|
|
# line-numbers = "true";
|
|
# line-numbers-minus-style = "#444444";
|
|
# line-numbers-zero-style = "#444444";
|
|
# line-numbers-plus-style = "#444444";
|
|
# line-numbers-left-format = "{nm:>4}┊";
|
|
# line-numbers-right-format = "{np:>4}│";
|
|
# line-numbers-left-style = "blue";
|
|
# line-numbers-right-style = "blue";
|
|
# };
|
|
#};
|
|
extraConfig = {
|
|
core = {
|
|
packedGitWindowSize = "16m";
|
|
packedGitLimit = "64m";
|
|
};
|
|
pack = {
|
|
windowMemory = "64m";
|
|
packSizeLimit = "64m";
|
|
thread = "1";
|
|
deltaCacheSize = "1m";
|
|
};
|
|
color = {
|
|
branch = "auto";
|
|
diff = "auto";
|
|
status = "auto";
|
|
};
|
|
push.default = "simple";
|
|
pull.rebase = "true";
|
|
branch.autosetuprebase = "always";
|
|
log.follow = true;
|
|
};
|
|
includes = let
|
|
mkDefaultConfig = (dir: {
|
|
condition = "gitdir:${dir}";
|
|
contents = {
|
|
user = {
|
|
signingkey = "0x8A52A140BEBF7D2C";
|
|
email = "fabian@fh2.ch";
|
|
name = "Fabian Hauser";
|
|
};
|
|
};
|
|
});
|
|
workConfig = {
|
|
contents = {
|
|
commit.gpgsign = true;
|
|
tag.gpgsign = true;
|
|
user = {
|
|
signingkey = "0xE0CDD70E5D286D64";
|
|
email = "fabian.hauser@threema.ch";
|
|
};
|
|
url."git@work.github.com".insteadOf = "git@github.com";
|
|
};
|
|
};
|
|
in [
|
|
(mkDefaultConfig "~/private/")
|
|
(mkDefaultConfig "/etc/nixos/")
|
|
(mkDefaultConfig "~/.password-store/")
|
|
(mkDefaultConfig "~/shares/cloud.qo.is/")
|
|
((mkDefaultConfig "~/work/") // workConfig)
|
|
((mkDefaultConfig "~/shares/cloud.threema.ch/") // workConfig)
|
|
];
|
|
ignores = [ "*~" "*.swp" ".direnv/" ];
|
|
lfs.enable = true;
|
|
};
|
|
}
|