mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-07 17:41:03 +01:00
diff-highlight: add git package assertion
Git package can be made nullable now, but module is written with expectation of its availability. Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
36817384a6
commit
012cfcc44a
1 changed files with 13 additions and 3 deletions
|
|
@ -68,8 +68,15 @@ in
|
||||||
in
|
in
|
||||||
lib.mkMerge [
|
lib.mkMerge [
|
||||||
(mkIf cfg.enable {
|
(mkIf cfg.enable {
|
||||||
# Auto-enable git integration if programs.git.diff-highlight.enable was set to true
|
assertions = [
|
||||||
programs.diff-highlight.enableGitIntegration = lib.mkIf oldOptionEnabled (lib.mkOverride 1490 true);
|
{
|
||||||
|
assertion = !cfg.enableGitIntegration || config.programs.git.package != null;
|
||||||
|
message = ''
|
||||||
|
programs.diff-highlight.enableGitIntegration requires programs.git.package to be set.
|
||||||
|
Please set programs.git.package to a valid git package.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
warnings =
|
warnings =
|
||||||
lib.optional
|
lib.optional
|
||||||
|
|
@ -77,9 +84,12 @@ in
|
||||||
cfg.enableGitIntegration && options.programs.diff-highlight.enableGitIntegration.highestPrio == 1490
|
cfg.enableGitIntegration && options.programs.diff-highlight.enableGitIntegration.highestPrio == 1490
|
||||||
)
|
)
|
||||||
"`programs.diff-highlight.enableGitIntegration` automatic enablement is deprecated. Please explicitly set `programs.diff-highlight.enableGitIntegration = true`.";
|
"`programs.diff-highlight.enableGitIntegration` automatic enablement is deprecated. Please explicitly set `programs.diff-highlight.enableGitIntegration = true`.";
|
||||||
|
|
||||||
|
# Auto-enable git integration if programs.git.diff-highlight.enable was set to true
|
||||||
|
programs.diff-highlight.enableGitIntegration = lib.mkIf oldOptionEnabled (lib.mkOverride 1490 true);
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf (cfg.enable && cfg.enableGitIntegration) {
|
(mkIf (cfg.enable && cfg.enableGitIntegration && config.programs.git.package != null) {
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = lib.mkDefault true;
|
enable = lib.mkDefault true;
|
||||||
iniContent =
|
iniContent =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue