treewide: move defaults to dedicated folder
This commit is contained in:
parent
a652c76523
commit
00c06f982b
6 changed files with 0 additions and 0 deletions
47
defaults/git.nix
Normal file
47
defaults/git.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
name = "git";
|
||||
cfg = config.nixowos.cli.${name};
|
||||
in
|
||||
{
|
||||
options.nixowos.cli.${name} = {
|
||||
enable = lib.mkEnableOption name;
|
||||
|
||||
delta.enable = lib.mkEnableOption "delta within git" // {
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
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 = "${pkgs.delta}/bin/delta";
|
||||
interactive.diffFilter = "${pkgs.delta}/bin/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
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue