WIP: add jujutsu (w/ Delta)
This commit is contained in:
parent
b093faf00d
commit
01116d9480
3 changed files with 121 additions and 0 deletions
|
|
@ -24,6 +24,7 @@
|
||||||
./gtk
|
./gtk
|
||||||
./htop
|
./htop
|
||||||
./jq
|
./jq
|
||||||
|
./jujutsu
|
||||||
./keyboard
|
./keyboard
|
||||||
./mail
|
./mail
|
||||||
./mpv
|
./mpv
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,10 @@ in
|
||||||
git = {
|
git = {
|
||||||
enable = my.mkDisableOption "git integration";
|
enable = my.mkDisableOption "git integration";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
jujutsu = {
|
||||||
|
enable = my.mkDisableOption "jujutsu integration";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
@ -30,6 +34,13 @@ in
|
||||||
enabled.
|
enabled.
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
assertion = cfg.jujutsu.enable -> cfg.git.enable;
|
||||||
|
message = ''
|
||||||
|
`config.my.home.delta.jujutsu` relies on `config.my.home.delta.git`
|
||||||
|
being enabled.
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
@ -64,5 +75,23 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.jujutsu = lib.mkIf cfg.jujutsu.enable {
|
||||||
|
settings = {
|
||||||
|
merge-tools = {
|
||||||
|
delta = {
|
||||||
|
# Errors are signaled with exit codes greater or equal to 2
|
||||||
|
diff-expected-exit-codes = [ 0 1 ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
ui = {
|
||||||
|
# Delta expects a `git diff` input
|
||||||
|
diff-formatter = ":git";
|
||||||
|
|
||||||
|
pager = "${lib.getExe cfg.package}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
91
modules/home/jujutsu/default.nix
Normal file
91
modules/home/jujutsu/default.nix
Normal file
|
|
@ -0,0 +1,91 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.jujutsu;
|
||||||
|
|
||||||
|
inherit (lib.my) mkMailAddress;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.home.jujutsu = with lib; {
|
||||||
|
enable = my.mkDisableOption "jujutsu configuration";
|
||||||
|
|
||||||
|
package = mkPackageOption pkgs "jujutsu" { };
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
# For `jj git` commands
|
||||||
|
assertion = cfg.enable -> config.my.home.git.enable;
|
||||||
|
message = ''
|
||||||
|
`config.my.home.jujutsu` relies on `config.my.home.git` being enabled.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.jujutsu = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
inherit (cfg) package;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
# Who am I?
|
||||||
|
user = {
|
||||||
|
name = "Bruno BELANYI";
|
||||||
|
email = mkMailAddress "bruno" "belanyi.fr";
|
||||||
|
};
|
||||||
|
|
||||||
|
aliases = {
|
||||||
|
jj = [ "util" "exec" "--" "jj" ];
|
||||||
|
# FIXME:
|
||||||
|
# * topo sort by default (I think? test it)
|
||||||
|
# * still not a big fan of the template
|
||||||
|
lol = [ "log" "-r" "..@" "-T" "builtin_log_oneline" ];
|
||||||
|
lola = [ "lol" "-r" "all()" ];
|
||||||
|
# FIXME: equivalent to `git switch -`
|
||||||
|
# See https://github.com/jj-vcs/jj/issues/2871
|
||||||
|
# Might be broken recently https://discord.com/channels/968932220549103686/1380272574709366989/1380432041983606855
|
||||||
|
# TODO:
|
||||||
|
# * `pick` (https://github.com/jj-vcs/jj/issues/5446): [ "util" "exec" "--" "bash" "-c" "jj log -p -r \"diff_contains($1)\"" ]
|
||||||
|
# * `root`: `jj workspace root` (barely necessary then)
|
||||||
|
};
|
||||||
|
|
||||||
|
# FIXME: `extraConfig` equivalents...
|
||||||
|
|
||||||
|
# FIXME: from ma_9's config, plus my own stuff
|
||||||
|
# snapshot = {
|
||||||
|
# auto-track = "none()";
|
||||||
|
# };
|
||||||
|
#
|
||||||
|
# ui = {
|
||||||
|
# diff-editor = ":builtin"; # To silence hints
|
||||||
|
# movement = {
|
||||||
|
# edit = false;
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
|
||||||
|
|
||||||
|
"--scope" = [
|
||||||
|
# Multiple identities
|
||||||
|
{
|
||||||
|
"--when" = {
|
||||||
|
repositories = [ "~/git/EPITA/" ];
|
||||||
|
};
|
||||||
|
user = {
|
||||||
|
name = "Bruno BELANYI";
|
||||||
|
email = mkMailAddress "bruno.belanyi" "epita.fr";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
"--when" = {
|
||||||
|
repositories = [ "~/git/work/" ];
|
||||||
|
};
|
||||||
|
user = {
|
||||||
|
name = "Bruno BELANYI";
|
||||||
|
email = mkMailAddress "ambroisie" "google.com";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue