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, ... }:
let
cfg = config.my.home.delta;
configFormat = pkgs.formats.gitIni { };
configPath = "${config.xdg.configHome}/delta/config";
in
{
options.my.home.delta = with lib; {
@ -17,28 +14,14 @@ in
};
config = lib.mkIf cfg.enable {
assertions = [
{
# 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.
'';
}
];
programs.delta = {
enable = true;
home.packages = [ cfg.package ];
inherit (cfg) package;
xdg.configFile."delta/config".source = configFormat.generate "delta-config" {
delta = {
enableGitIntegration = cfg.git.enable;
options = {
features = "diff-highlight decorations";
# 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;
}
];
};
};
}