home: delta: use stand-alone configuration file
Ideally, I'd like for `delta` to just read a configuration file at `$XDG_CONFIG_HOME/delta/config` by default, but upstream seems somewhat reticent to the idea :-/. So instead, let's keep relying on `git` being enabled, but rather than inlining the configuration, let's store it where I think it should belong and include it into `gitconfig`.
This commit is contained in:
parent
1800cb9daa
commit
3fa1664b5c
1 changed files with 35 additions and 24 deletions
|
|
@ -1,6 +1,9 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.delta;
|
||||
|
||||
configFormat = pkgs.formats.gitIni { };
|
||||
configPath = "${config.xdg.configHome}/delta/config";
|
||||
in
|
||||
{
|
||||
options.my.home.delta = with lib; {
|
||||
|
|
@ -34,35 +37,43 @@ in
|
|||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile."delta/config".source = configFormat.generate "delta-config" {
|
||||
delta = {
|
||||
features = "diff-highlight decorations";
|
||||
|
||||
# Less jarring style for `diff-highlight` emulation
|
||||
diff-highlight = {
|
||||
minus-style = "red";
|
||||
minus-non-emph-style = "red";
|
||||
minus-emph-style = "bold red 52";
|
||||
|
||||
plus-style = "green";
|
||||
plus-non-emph-style = "green";
|
||||
plus-emph-style = "bold green 22";
|
||||
|
||||
whitespace-error-style = "reverse red";
|
||||
};
|
||||
|
||||
# Personal preference for easier reading
|
||||
decorations = {
|
||||
commit-style = "raw"; # Do not recolor meta information
|
||||
keep-plus-minus-markers = true;
|
||||
paging = "always";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.git = lib.mkIf cfg.git.enable {
|
||||
delta = {
|
||||
enable = true;
|
||||
inherit (cfg) package;
|
||||
|
||||
options = {
|
||||
features = "diff-highlight decorations";
|
||||
|
||||
# Less jarring style for `diff-highlight` emulation
|
||||
diff-highlight = {
|
||||
minus-style = "red";
|
||||
minus-non-emph-style = "red";
|
||||
minus-emph-style = "bold red 52";
|
||||
|
||||
plus-style = "green";
|
||||
plus-non-emph-style = "green";
|
||||
plus-emph-style = "bold green 22";
|
||||
|
||||
whitespace-error-style = "reverse red";
|
||||
};
|
||||
|
||||
# Personal preference for easier reading
|
||||
decorations = {
|
||||
commit-style = "raw"; # Do not recolor meta information
|
||||
keep-plus-minus-markers = true;
|
||||
paging = "always";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
includes = [
|
||||
{
|
||||
path = configPath;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue