2022-04-27 00:21:19 +02:00
|
|
|
{ pkgs
|
|
|
|
, config
|
|
|
|
, lib
|
|
|
|
, ...
|
2022-03-01 22:19:03 +01:00
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.eboskma.programs.git;
|
2022-04-27 00:21:19 +02:00
|
|
|
in
|
|
|
|
{
|
2021-11-21 19:07:12 +01:00
|
|
|
options.eboskma.programs.git = {
|
|
|
|
enable = mkEnableOption "enable git";
|
|
|
|
|
|
|
|
name = mkOption {
|
|
|
|
description = "your name";
|
|
|
|
type = types.nonEmptyStr;
|
|
|
|
};
|
|
|
|
|
|
|
|
email = mkOption {
|
|
|
|
description = "your e-mail address";
|
|
|
|
type = types.nonEmptyStr;
|
|
|
|
};
|
|
|
|
|
|
|
|
signingKey = mkOption {
|
|
|
|
description = "your GPG signing key ID";
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = null;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-05-03 18:17:38 +02:00
|
|
|
config = mkIf cfg.enable {
|
2021-11-21 19:07:12 +01:00
|
|
|
programs.git = {
|
|
|
|
enable = true;
|
|
|
|
userName = cfg.name;
|
|
|
|
userEmail = cfg.email;
|
|
|
|
signing = mkIf (cfg.signingKey != null) {
|
|
|
|
key = cfg.signingKey;
|
|
|
|
signByDefault = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
delta = {
|
|
|
|
enable = true;
|
|
|
|
options = {
|
2022-03-22 10:59:19 +01:00
|
|
|
side-by-side = false;
|
2021-11-21 19:07:12 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
aliases = {
|
|
|
|
ls = "ls-files";
|
|
|
|
ignored = "ls-files -o -i --exclude-standard";
|
|
|
|
st = "status -s -b";
|
|
|
|
branches = "branch -a";
|
|
|
|
tags = "tag";
|
|
|
|
stashes = "stash list";
|
|
|
|
nevermind = "!git reset --hard HEAD && git clean -d -f";
|
|
|
|
graph = "log --graph -10 --branches --remotes --tags --format=format:'%Cgreen%h %Creset• %<(75,trunc)%s (%cN, %cr) %Cred%d' --date-order";
|
|
|
|
precommit = "diff --cached --diff-algorithm=minimal -w";
|
|
|
|
track = "branch -u";
|
|
|
|
stat = "status -s";
|
|
|
|
up = "pull --autostash --rebase";
|
|
|
|
cm = "commit -m";
|
|
|
|
changelog = "log --oneline --no-merges";
|
|
|
|
source = "remote get-url origin";
|
|
|
|
};
|
|
|
|
|
|
|
|
extraConfig = {
|
2022-03-01 22:19:03 +01:00
|
|
|
credential.helper = "${pkgs.git.override {withLibsecret = true;}}/bin/git-credential-libsecret";
|
2021-11-21 19:07:12 +01:00
|
|
|
init = {
|
|
|
|
defaultBranch = "main";
|
|
|
|
};
|
|
|
|
core = {
|
|
|
|
editor = "${pkgs.neovim}/bin/nvim";
|
|
|
|
# pager = "${pkgs.bat}/bin/bat";
|
|
|
|
};
|
|
|
|
merge = {
|
|
|
|
ff = "only";
|
|
|
|
conflictstyle = "diff3";
|
|
|
|
tool = "${pkgs.meld}/bin/meld";
|
|
|
|
};
|
|
|
|
pull = {
|
|
|
|
ff = "only";
|
|
|
|
};
|
|
|
|
rebase = {
|
|
|
|
autoStash = true;
|
|
|
|
};
|
|
|
|
color = {
|
|
|
|
ui = "auto";
|
|
|
|
status = {
|
|
|
|
added = "yellow";
|
|
|
|
changed = "green";
|
|
|
|
untracked = "cyan";
|
|
|
|
};
|
|
|
|
branch = {
|
|
|
|
current = "yellow reverse";
|
|
|
|
local = "yellow";
|
|
|
|
remote = "green";
|
|
|
|
};
|
|
|
|
diff = {
|
|
|
|
meta = "yellow bold";
|
|
|
|
frag = "magenta bold";
|
|
|
|
old = "red bold";
|
|
|
|
new = "green bold";
|
|
|
|
};
|
|
|
|
};
|
2022-01-24 11:15:17 +01:00
|
|
|
grep = {
|
|
|
|
lineNumber = true;
|
|
|
|
column = true;
|
|
|
|
patternType = "extended";
|
|
|
|
};
|
2021-11-21 19:07:12 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.gh = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
git_protocol = "ssh";
|
2021-12-06 09:58:39 +01:00
|
|
|
editor = "nvim";
|
|
|
|
prompt = "enabled";
|
|
|
|
pager = "bat";
|
|
|
|
http_unix_socket = "";
|
|
|
|
browser = "";
|
2021-11-21 19:07:12 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|