home: delta: use upstream module
This commit is contained in:
parent
9ddc77958a
commit
4000a848ef
1 changed files with 6 additions and 36 deletions
|
|
@ -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;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue