Compare commits

...

8 commits

Author SHA1 Message Date
2a6b013a4c WIP: ADD NOTE FOR FUTURE SELF
Some checks failed
ci/woodpecker/push/check Pipeline failed
2025-10-20 10:52:11 +00:00
9c6baa168d homes: mousqueton: use system jujutsu
They have a custom `jj` with Piper CitC integration.
2025-10-20 10:51:58 +00:00
852d5d8824 homes: bazin: use system jujutsu
They have a custom `jj` with Piper CitC integration.
2025-10-20 10:51:58 +00:00
b9c65ddbb5 home: jujutsu: simplify 'jj jj' alias 2025-10-20 10:51:56 +00:00
74134893f1 home: jujutsu: explicitly create 'conf.d'
This is to serve as a reminder of _how_ to add a local configuration
file.
2025-10-20 10:51:33 +00:00
0217af7619 home: jj: use verbose draft commit messages 2025-10-20 10:50:33 +00:00
1444d5a616 home: delta: add 'jujutsu.enable' 2025-10-20 10:50:05 +00:00
332c94474c home: add jujutsu
This is a very basic configuration, still missing most bells and
whistles.
2025-10-20 10:48:48 +00:00
5 changed files with 163 additions and 0 deletions

View file

@ -22,6 +22,10 @@
package = pkgs.emptyDirectory;
};
jujutsu = {
package = pkgs.emptyDirectory;
};
tmux = {
# I use scripts that use the passthrough sequence often on this host
enablePassthrough = true;

View file

@ -25,6 +25,10 @@
package = pkgs.emptyDirectory;
};
jujutsu = {
package = pkgs.emptyDirectory;
};
tmux = {
# I use scripts that use the passthrough sequence often on this host
enablePassthrough = true;

View file

@ -24,6 +24,7 @@
./gtk
./htop
./jq
./jujutsu
./keyboard
./mail
./mpv

View file

@ -11,6 +11,10 @@ in
git = {
enable = my.mkDisableOption "git integration";
};
jujutsu = {
enable = my.mkDisableOption "jujutsu integration";
};
};
config = lib.mkIf cfg.enable {
@ -45,5 +49,24 @@ 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";
# `finalPackage` automatically applied `--config` if necessary
pager = [ config.programs.delta.finalPackage ];
};
};
};
};
}

View file

@ -0,0 +1,131 @@
{ 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 = [ ];
# FIXME:
# * 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: git equivalents
# I'd like a better formatted blame (more like delta's?)
# blame = {
# coloring = "repeatedLines";
# markIgnoredLines = true;
# markUnblamables = true;
# };
# FIXME: log colors should probably match git
# FIXME: patience diff?
# FIXME: fetch prune/pruneTags?
# FIXME: pull.rebase=true? Probably true TBH
# FIXME: push.default=simple? Probably true TBH
# FIXME: conflict style? ui.conflict-marker-style=git is diff3, not zdiff3. Default looks fine-ish
# FIXME: from ma_9's config, plus my own stuff
# snapshot = {
# auto-track = "none()";
# };
#
# ui = {
# diff-editor = ":builtin"; # To silence hints
# movement = {
# edit = false;
# };
# };
templates = {
# Equivalent to `commit.verbose = true` in Git
draft_commit_description = "commit_description_verbose(self)";
};
template-aliases = {
"commit_description_verbose(commit)" = ''
concat(
commit_description(commit),
"JJ: ignore-rest\n",
diff.git(),
)
'';
# FIXME: use `diff.summary()` instead? Supported by syntax highlighting
# See https://github.com/jj-vcs/jj/issues/1946#issuecomment-2572986485
# FIXME: tree-sitter grammar isn't in `nvim-treesitter` (https://github.com/kareigu/tree-sitter-jjdescription)
"commit_description(commit)" = ''
concat(
commit.description(), "\n",
"JJ: This commit contains the following changes:\n",
indent("JJ: ", diff.stat(72)),
)
'';
};
"--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";
};
}
];
};
};
# To drop in a `local.toml` configuration, not-versioned
xdg.configFile = {
"jj/conf.d/.keep".text = "";
};
};
}