Skip to content

Commit

Permalink
feat: configured git
Browse files Browse the repository at this point in the history
  • Loading branch information
standard3 committed Apr 1, 2024
1 parent b9f469b commit 94a0590
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions home/applications/tools/git.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,81 @@
{ config, pkgs, ... }:

{
programs.git = {
enable = true;

# User and signature
userName = "std3";
userEmail = "67806187+standard3@users.noreply.github.com";

iniContent.gpg = {
format = "ssh";
ssh = {
allowedSignersFile = "${config.home.homeDirectory}/.ssh/allowed_signers";
};
};

signing = {
key = "${config.home.homeDirectory}/.ssh/id_rsa.pub";
signByDefault = true;
};

ignores = [
"*.direnv"
"*.devenv"
"*.envrc"
];

delta.enable = true;

aliases = {
loc = "!f(){ git ls-files | ${pkgs.ripgrep}/bin/rg \"\\.\${1}\" | xargs wc -l; };f"; # lines of code
br = "branch";
ch = "checkout";
chb = "checkout -b";
st = "status";
cm = "commit -m";
ca = "commit -am";
fuck = "commit --amend -m";
dc = "diff --cached";
graph = "log --all --decorate --graph";
hist = ''
log --pretty=format:"%Cgreen%h %Creset%cd %Cblue[%cn] %Creset%s%C(yellow)%d%C(reset)" --graph --date=relative --decorate --all
'';
};

extraConfig = {
color.ui = true;
column.ui = "auto";

core = {
editor = "nvim";
untrackedcache = true;
fsmonitor = true;
};

init.defaultBranch = "main";
pull.rebase = false;
push.autoSetupRemote = true;
fetch.writeCommitGraph = true;
branch.sort = "-comitterdate";

rerere.enabled = true;

url = {
"https://github.com/".insteadOf = "gh:";
"ssh://git@github.com".pushInsteadOf = "gh:";
"https://gitlab.com/".insteadOf = "gl:";
"ssh://git@gitlab.com".pushInsteadOf = "gl:";
};
};

# IncludeIf
includes = [
{
path = "${config.home.homeDirectory}/2600/.gitconfig";
condition = "gitdir:${config.home.homeDirectory}/2600/";
}
];
};
}

0 comments on commit 94a0590

Please sign in to comment.