mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
Adds Home Manager module for ec, a 3-way terminal native Git merge conflict resolver. The module supports: - Git integration by configuring ec as a mergetool.
43 lines
908 B
Nix
43 lines
908 B
Nix
{
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.programs.ec;
|
|
ec = lib.getExe cfg.package;
|
|
in
|
|
{
|
|
meta.maintainers = [ lib.maintainers.kpbaks ];
|
|
|
|
options = {
|
|
programs.ec = {
|
|
enable = lib.mkEnableOption "ec, 3-way terminal native Git merge conflict resolver";
|
|
package = lib.mkPackageOption pkgs "ec" { };
|
|
|
|
enableGitIntegration = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
description = ''
|
|
Whether to enable git integration for ec.
|
|
|
|
When enabled, ec will be configured as git's merge tool.
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
home.packages = [ cfg.package ];
|
|
|
|
programs.git.settings = lib.mkIf cfg.enableGitIntegration {
|
|
merge.tool = "ec";
|
|
mergetool.ec = {
|
|
cmd = ''${ec} "$BASE" "$LOCAL" "$REMOTE" "$MERGED"'';
|
|
trustExitCode = true;
|
|
};
|
|
};
|
|
};
|
|
}
|