nixos-config/home-manager/modules/jujutsu/default.nix

87 lines
1.6 KiB
Nix

{
pkgs,
config,
lib,
...
}:
with lib;
let
cfg = config.eboskma.programs.jujutsu;
in
{
options.eboskma.programs.jujutsu = {
enable = mkEnableOption "jujutsu";
name = mkOption {
description = "your name";
type = types.nonEmptyStr;
};
email = mkOption {
description = "your e-mail address";
type = types.nonEmptyStr;
};
signingKey = mkOption {
description = "your signing key";
type = types.nullOr types.str;
default = null;
};
signingBackend = mkOption {
description = "the type of signing key";
type = types.enum [
"gpg"
"ssh"
];
default = "openpgp";
};
};
config = mkIf cfg.enable {
programs.jujutsu = {
enable = true;
ediff = false;
settings = {
user = {
name = cfg.name;
email = cfg.email;
};
core = {
fsmonitor = "watchman";
watchman.register_snapshot_triggers = true;
};
ui = {
diff = {
tool = "difftastic";
};
pager = lib.getExe pkgs.bat;
};
merge-tools = {
difftastic = {
program = lib.getExe pkgs.difftastic;
diff-args = [
"--color=always"
"--background=dark"
"--display=side-by-side-show-both"
"$left"
"$right"
];
};
};
signing = {
sign-all = true;
backend = cfg.signingBackend;
key = cfg.signingKey;
};
};
};
home.packages = with pkgs; [ watchman ];
};
}