summaryrefslogtreecommitdiff
path: root/jj.nix
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2025-10-17 14:48:18 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2025-10-17 14:48:18 +0200
commit0b35db5b683065569b0ea9282e40a7b7e1530324 (patch)
treee412d462a2392de9e126a9fa7ada8345baff2ba4 /jj.nix
parent020629e8c51bd0d3fa3eacc49ef35817a1fc225b (diff)
downloadhome-manager-0b35db5b683065569b0ea9282e40a7b7e1530324.tar.gz
home-manager-0b35db5b683065569b0ea9282e40a7b7e1530324.tar.bz2
home-manager-0b35db5b683065569b0ea9282e40a7b7e1530324.zip
Add jj configuration
Diffstat (limited to 'jj.nix')
-rw-r--r--jj.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/jj.nix b/jj.nix
new file mode 100644
index 0000000..c74bf17
--- /dev/null
+++ b/jj.nix
@@ -0,0 +1,36 @@
+{
+ pkgs,
+ inputs,
+ git,
+ ...
+}: let
+ tomlFormat = pkgs.formats.toml {};
+in {
+ xdg.configFile."jj/config.toml".source = tomlFormat.generate "config.toml" {
+ user = {
+ name = git.name;
+ email = git.email;
+ };
+ ui = {
+ diff-formatter = ":git";
+ pager = ":builtin";
+ };
+ aliases = {
+ wk = ["log" "-r" "trunk()::@ | @::"];
+ gp = ["git" "push" "--allow-new"];
+ gf = ["git" "fetch"];
+ tracked = ["bookmark" "list" "-t" "-T" ''if(self.tracked(), if(self.name() != "main", self.name()++"\n"))''];
+ untracked = ["bookmark" "list" "-T" ''if(!self.tracked(), if(self.name() != "main", self.name()++"\n"))''];
+ e = ["edit"];
+ track = ["util" "exec" "--" "bash" "-c" "jj bookmark set $(jj log -r @ -T 'self.change_id()' --no-graph)"];
+ tug = ["bookmark" "move" "--from" "heads(::@- & bookmarks())" "--to" "@-"];
+ nm = ["new" "-r" "trunk()"];
+ };
+ templates = {
+ log = "builtin_log_compact";
+ };
+ template-aliases = {
+ "commit_timestamp(commit)" = "commit.author().timestamp()";
+ };
+ };
+}