2025-05-22 20:01:01 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
2025-07-20 01:23:48 +02:00
|
|
|
}:
|
|
|
|
let
|
2025-05-22 20:01:01 +02:00
|
|
|
inherit (lib.meta) getExe;
|
|
|
|
|
2025-07-20 01:23:48 +02:00
|
|
|
toml = pkgs.formats.toml { };
|
2025-05-22 20:01:01 +02:00
|
|
|
jj-config = toml.generate "config.toml" {
|
|
|
|
user = {
|
|
|
|
name = "Bloxx12";
|
|
|
|
email = "charlie@charlieroot.dev";
|
|
|
|
};
|
|
|
|
|
|
|
|
ui = {
|
2025-07-20 01:23:48 +02:00
|
|
|
pager = [
|
|
|
|
"${getExe pkgs.bat}"
|
|
|
|
"--plain"
|
|
|
|
];
|
2025-05-22 20:01:01 +02:00
|
|
|
default-command = "log";
|
|
|
|
movement.edit = true;
|
|
|
|
|
2025-07-20 01:23:48 +02:00
|
|
|
diff.tool = [
|
|
|
|
"${getExe pkgs.difftastic}"
|
|
|
|
"--color"
|
|
|
|
"always"
|
|
|
|
"$left"
|
|
|
|
"$right"
|
|
|
|
];
|
2025-05-22 20:01:01 +02:00
|
|
|
};
|
|
|
|
# FIXME: do this with agenix
|
|
|
|
# "--scope" = [
|
|
|
|
# {
|
|
|
|
# "--when.repositories" = ["~/repos/projects/uni"];
|
|
|
|
# user = {
|
|
|
|
# # TODO
|
|
|
|
# name = "";
|
|
|
|
# email = "";
|
|
|
|
# };
|
|
|
|
# }
|
|
|
|
# {
|
|
|
|
# "--when.repositories" = ["~/repos/projects/uni/"];
|
|
|
|
# user = {
|
|
|
|
# # TODO
|
|
|
|
# name = "";
|
|
|
|
# email = "";
|
|
|
|
# };
|
|
|
|
# }
|
|
|
|
# ];
|
|
|
|
git.push-new-bookmarks = true;
|
|
|
|
|
|
|
|
signing = {
|
|
|
|
behaviour = "own";
|
|
|
|
backend = "ssh";
|
2025-07-20 01:23:48 +02:00
|
|
|
key = [
|
|
|
|
"ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAAWEDj/Yib6Mqs016jx7rtecWpytwfVl28eoHtPYCM9TVLq81VIHJSN37lbkc/JjiXCdIJy2Ta3A3CVV5k3Z37NbgAu23oKA2OcHQNaRTLtqWlcBf9fk9suOkP1A3NzAqzivFpBnZm3ytaXwU8LBJqxOtNqZcFVruO6fZxJtg2uE34mAw=="
|
|
|
|
];
|
2025-05-22 20:01:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
aliases = {
|
2025-07-20 01:23:48 +02:00
|
|
|
c = [ "commit" ];
|
|
|
|
ci = [
|
|
|
|
"commit"
|
|
|
|
"--interactive"
|
|
|
|
];
|
2025-05-22 20:01:01 +02:00
|
|
|
|
2025-07-20 01:23:48 +02:00
|
|
|
e = [ "edit" ];
|
2025-05-22 20:01:01 +02:00
|
|
|
|
|
|
|
# "new bookmark"
|
2025-07-20 01:23:48 +02:00
|
|
|
nb = [
|
|
|
|
"bookmark"
|
|
|
|
"create"
|
|
|
|
"-r @-"
|
|
|
|
];
|
2025-05-22 20:01:01 +02:00
|
|
|
|
2025-07-20 01:23:48 +02:00
|
|
|
pull = [
|
|
|
|
"git"
|
|
|
|
"fetch"
|
|
|
|
];
|
|
|
|
push = [
|
|
|
|
"git"
|
|
|
|
"push"
|
|
|
|
"--allow-new"
|
|
|
|
];
|
2025-05-22 20:01:01 +02:00
|
|
|
|
2025-07-20 01:23:48 +02:00
|
|
|
r = [ "rebase" ];
|
|
|
|
s = [ "squash" ];
|
|
|
|
si = [
|
|
|
|
"squash"
|
|
|
|
"--interactive"
|
|
|
|
];
|
2025-05-22 20:01:01 +02:00
|
|
|
|
2025-07-20 01:23:48 +02:00
|
|
|
tug = [
|
|
|
|
"bookmark"
|
|
|
|
"move"
|
|
|
|
"--from"
|
|
|
|
"closest_bookmark(@-)"
|
|
|
|
"--to"
|
|
|
|
"@-"
|
|
|
|
];
|
2025-05-22 20:01:01 +02:00
|
|
|
};
|
|
|
|
revset-aliases = {
|
|
|
|
"closest_bookmark(to)" = "heads(::to & bookmarks())";
|
|
|
|
};
|
|
|
|
|
|
|
|
templates = {
|
|
|
|
draft_commit_description = ''
|
|
|
|
concat(
|
|
|
|
coalesce(description, "\n"),
|
|
|
|
surround(
|
|
|
|
"\nJJ: This commit contains the following changes:\n", "",
|
|
|
|
indent("JJ: ", diff.stat(72)),
|
|
|
|
),
|
|
|
|
"\nJJ: ignore-rest\n",
|
|
|
|
diff.git(),
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
template-aliases = {
|
|
|
|
"format_short_id(id)" = "id.shortest()";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
jj-wrapped = pkgs.symlinkJoin {
|
|
|
|
name = "jj-wrapped";
|
2025-07-20 01:23:48 +02:00
|
|
|
paths = [ pkgs.jj ];
|
|
|
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
2025-05-22 20:01:01 +02:00
|
|
|
postBuild = ''
|
|
|
|
wrapProgram $out/bin/mako --add-flags "\
|
|
|
|
--config ${jj-config}
|
|
|
|
|
|
|
|
'';
|
|
|
|
};
|
2025-07-20 01:23:48 +02:00
|
|
|
in
|
|
|
|
{
|
2025-05-26 10:00:02 +02:00
|
|
|
# environment.systemPackages = [jj-wrapped];
|
2025-05-22 20:01:01 +02:00
|
|
|
}
|