patdiff: new module

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman 2025-10-16 21:11:02 -05:00
parent 4fef8e73a6
commit c80be80282
5 changed files with 87 additions and 65 deletions

View file

@ -316,16 +316,6 @@ in
};
};
patdiff = {
enable = mkEnableOption "" // {
description = ''
Whether to enable the {command}`patdiff` differ.
See <https://opensource.janestreet.com/patdiff/>
'';
};
package = mkPackageOption pkgs "patdiff" { };
};
};
};
@ -355,8 +345,8 @@ in
(config.programs.diff-highlight.enable && config.programs.diff-highlight.enableGitIntegration)
(config.programs.diff-so-fancy.enable && config.programs.diff-so-fancy.enableGitIntegration)
(config.programs.difftastic.enable && config.programs.difftastic.git.enable)
(config.programs.patdiff.enable && config.programs.patdiff.enableGitIntegration)
cfg.riff.enable
cfg.patdiff.enable
];
in
lib.count lib.id enabled <= 1;
@ -654,20 +644,6 @@ in
}
)
(
let
patdiffPackage = cfg.patdiff.package;
patdiffCommand = "${lib.getExe' patdiffPackage "patdiff-git-wrapper"}";
in
mkIf cfg.patdiff.enable {
home.packages = [ patdiffPackage ];
programs.git.iniContent = {
diff.external = patdiffCommand;
};
}
)
(mkIf (cfg.riff.enable && cfg.riff.commandLineOptions != "") {
home.sessionVariables.RIFF = cfg.riff.commandLineOptions;
})