system/home/users/jan/git/default.nix

66 lines
1.6 KiB
Nix

{ pkgs, ... }:
{
home.packages = [ pkgs.git-crypt ];
programs.git = {
enable = true;
userEmail = "dmitriy@pleshevski.ru";
userName = "Dmitriy Pleshevskiy";
signing = {
key = "43669288EC334989";
signByDefault = true;
};
includes = [
# My main account was suspended due to sanctions
{
condition = "hasconfig:remote.*.url:git@github.com:**/**";
contents = import ./github.secret.nix;
}
# Work account
{
condition = "hasconfig:remote.*.url:git@gitlab.com:**/**";
contents = import ./gitlab.secret.nix;
}
];
ignores = [ ".nlsp-settings" ];
extraConfig = {
init.defaultBranch = "main";
pull.rebase = true;
};
aliases = {
co = "switch";
cob = "switch -c";
cobf = "switch -C";
st = "status -sb";
d = "diff";
dc = "diff --cached";
aa = "add .";
ai = "add -i";
c = "commit";
cm = "commit -m";
ca = "commit --amend";
cam = "commit --amend -m";
can = "commit --amend --no-edit";
p = "push";
po = "push origin";
pf = "push --force-with-lease";
pfo = "push --force-with-lease origin";
pl = "pull";
plo = "pull origin";
rb = "rebase";
rbi = "rebase -i";
rbc = "rebase --continue";
lo = "log --pretty=oneline";
sma = "submodule add";
smui = "submodule update --init";
s = "stash push";
sm = "stash push -m";
sl = "stash list";
sa = "stash apply";
sai = "stash apply --index";
sp = "stash pop";
spi = "stash pop --index";
};
};
}