home: delta: use upstream module

This commit is contained in:
Bruno BELANYI 2025-10-20 09:39:19 +00:00
parent 9ddc77958a
commit 4000a848ef

View file

@ -1,9 +1,6 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let let
cfg = config.my.home.delta; cfg = config.my.home.delta;
configFormat = pkgs.formats.gitIni { };
configPath = "${config.xdg.configHome}/delta/config";
in in
{ {
options.my.home.delta = with lib; { options.my.home.delta = with lib; {
@ -17,28 +14,14 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
assertions = [ programs.delta = {
{ enable = true;
# For its configuration
assertion = cfg.enable -> cfg.git.enable;
message = ''
`config.my.home.delta` must enable `config.my.home.delta.git` to be
properly configured.
'';
}
{
assertion = cfg.enable -> config.programs.git.enable;
message = ''
`config.my.home.delta` relies on `config.programs.git` to be
enabled.
'';
}
];
home.packages = [ cfg.package ]; inherit (cfg) package;
xdg.configFile."delta/config".source = configFormat.generate "delta-config" { enableGitIntegration = cfg.git.enable;
delta = {
options = {
features = "diff-highlight decorations"; features = "diff-highlight decorations";
# Less jarring style for `diff-highlight` emulation # Less jarring style for `diff-highlight` emulation
@ -62,18 +45,5 @@ in
}; };
}; };
}; };
programs.git = lib.mkIf cfg.git.enable {
delta = {
enable = true;
inherit (cfg) package;
};
includes = [
{
path = configPath;
}
];
};
}; };
} }