Files
.hive/modules/home/jj.nix

37 lines
839 B
Nix

{
config,
lib,
pkgs,
...
}: let
cfg = config.hive.jj;
in {
options.hive.jj = {
enable = lib.mkEnableOption "Enable jj vcs";
followGit = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Follow the current git configuration";
};
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
jujutsu
];
programs.jujutsu = {
enable = true;
settings = {
user = lib.optionalAttrs cfg.followGit {
name = config.programs.git.settings.user.name;
email = config.programs.git.settings.user.email;
};
ui = lib.optionalAttrs (cfg.followGit && config.programs.difftastic.enable) {
diff-formatter = ["${pkgs.difftastic}/bin/difft" "--color=always" "$left" "$right"];
};
};
};
};
}