1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00

git: add option to provide difftastic package

This commit is contained in:
Alex Lov 2024-08-31 18:14:50 +04:00 committed by Robert Helgesson
parent c2cd2a52e0
commit 471e3eb0a1
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED

View file

@ -222,6 +222,8 @@ in {
''; '';
}; };
package = mkPackageOption pkgs "difftastic" { };
background = mkOption { background = mkOption {
type = types.enum [ "light" "dark" ]; type = types.enum [ "light" "dark" ];
default = "light"; default = "light";
@ -478,11 +480,11 @@ in {
}) })
(mkIf cfg.difftastic.enable { (mkIf cfg.difftastic.enable {
home.packages = [ pkgs.difftastic ]; home.packages = [ cfg.difftastic.package ];
programs.git.iniContent = let programs.git.iniContent = let
difftCommand = concatStringsSep " " [ difftCommand = concatStringsSep " " [
"${pkgs.difftastic}/bin/difft" "${getExe cfg.difftastic.package}"
"--color ${cfg.difftastic.color}" "--color ${cfg.difftastic.color}"
"--background ${cfg.difftastic.background}" "--background ${cfg.difftastic.background}"
"--display ${cfg.difftastic.display}" "--display ${cfg.difftastic.display}"