home: delta: use stand-alone configuration file
Some checks failed
ci/woodpecker/push/check Pipeline failed
Some checks failed
ci/woodpecker/push/check Pipeline failed
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
f7a6ab0a63
commit
cb45ece777
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,12 +37,8 @@ in
|
|||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
programs.git = lib.mkIf cfg.git.enable {
|
||||
xdg.configFile."delta/config".source = configFormat.generate "delta-config" {
|
||||
delta = {
|
||||
enable = true;
|
||||
inherit (cfg) package;
|
||||
|
||||
options = {
|
||||
features = "diff-highlight decorations";
|
||||
|
||||
# Less jarring style for `diff-highlight` emulation
|
||||
|
|
@ -63,6 +62,18 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.git = lib.mkIf cfg.git.enable {
|
||||
delta = {
|
||||
enable = true;
|
||||
inherit (cfg) package;
|
||||
};
|
||||
|
||||
includes = [
|
||||
{
|
||||
path = configPath;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue