1
1
Fork 0

git: refactor config

This commit is contained in:
Myned 2025-03-31 19:07:46 -05:00
parent 441078e4dd
commit 8e16e85401
Signed by: myned
GPG key ID: C7224454F7881A34

View file

@ -6,34 +6,89 @@
with lib; let with lib; let
cfg = config.custom.programs.git; cfg = config.custom.programs.git;
in { in {
options.custom.programs.git.enable = mkOption {default = false;}; options.custom.programs.git = {
enable = mkOption {default = false;};
};
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config = mkIf cfg.enable {
# https://wiki.archlinux.org/title/Git home-manager.sharedModules = [
# https://git-scm.com {
programs.git = { # https://git-scm.com
enable = true; # https://wiki.nixos.org/wiki/Git
userName = "Myned"; # https://wiki.archlinux.org/title/Git
userEmail = "dev@${config.custom.domain}"; programs.git = {
enable = true;
userName = "Myned";
userEmail = "dev@${config.custom.domain}";
# BUG: GitHub Desktop tries to enable if this is not in gitconfig # BUG: GitHub Desktop tries to enable if this is not in gitconfig
lfs.enable = true; # Enable Large File Storage lfs.enable = true; # Large File Storage
signing = { signing = {
signByDefault = true; # TODO: Use ssh signing
key = "C7224454F7881A34"; format = "openpgp";
}; signByDefault = true;
key = "C7224454F7881A34";
};
extraConfig = { # https://git-scm.com/docs/git-config
fetch.prune = true; # https://git-scm.com/book/en/v2/
init.defaultBranch = "master"; # https://jvns.ca/blog/2024/02/16/popular-git-config-options/
push.autoSetupRemote = true; extraConfig = {
pull.ff = "only"; # https://git-scm.com/docs/git-config#Documentation/git-config.txt-alias
url."git@github.com:".insteadOf = [ #?? git ALIAS
"gh:" alias = {
"github:" # https://wiki.archlinux.org/title/Git#Visual_representation
]; graph = "log --graph --oneline --decorate";
}; };
};
diff = {
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-codediffalgorithmcode
algorithm = "histogram";
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-codediffcolorMovedcode
colorMoved = true;
};
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-fetchprune
fetch.prune = true;
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-formatsignOff
#?? Signed-off-by: USERNAME <EMAIL>
format.signOff = true;
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-helpautoCorrect
help.autoCorrect = "prompt";
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-codeinitdefaultBranchcode
init.defaultBranch = "master"; # owo
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-mergeconflictStyle
merge.conflictStyle = "zdiff3";
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-pushautoSetupRemote
push.autoSetupRemote = true;
# https://git-scm.com/docs/git-rebase
rebase = {
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-rebaseautoSquash
autoSquash = true;
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-rebaseautoStash
autoStash = true;
};
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-rerereenabled
rerere.enabled = true; # reuse recovered resolution
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-submodulerecurse
submodule.recurse = true;
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-transferfsckObjects
transfer.fsckObjects = true;
};
};
}
];
}; };
} }