This commit is contained in:
Elec3137 2026-02-04 12:17:42 -08:00
commit b4c9b055fb
20 changed files with 1540 additions and 0 deletions

52
cli/git.nix Normal file
View file

@ -0,0 +1,52 @@
{
pkgs,
lib,
config,
...
}:
let
name = "git";
cfg = config.nixowos.cli.${name};
in
{
options.nixowos.cli.${name} = {
enable = lib.mkEnableOption name;
delta.enable = lib.mkOption {
default = true;
example = false;
description = "Whether to enable delta with git integration.";
type = lib.types.bool;
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = lib.mkIf cfg.delta.enable [ pkgs.delta ];
programs.git = {
enable = true;
config = lib.mkMerge [
{
init.defaultBranch = "main";
core.compression = 9; # max
credential.helper = "cache";
push.autoSetupRemote = true;
pull.ff = "only";
merge.conflictStyle = "zdiff3";
commit.verbose = true; # show diffs in commit editor
}
(lib.mkIf cfg.delta.enable {
core.pager = "delta"; # depends on pkgs.delta!
interactive.diffFilter = "delta --color-only";
delta.navigate = true; # use n and N to move between diff sections
delta.diff-highlight = true; # simpler mode, highlights inter-line changes
})
];
};
};
}