feat(jujutsu): add jj-cz options to jujutsu module

This commit is contained in:
2026-03-14 14:21:13 +01:00
parent bfaaee0f36
commit 647432314d
4 changed files with 518 additions and 73 deletions

431
flake.lock generated
View File

@@ -1,5 +1,29 @@
{ {
"nodes": { "nodes": {
"alejandra": {
"inputs": {
"fenix": "fenix",
"flakeCompat": "flakeCompat",
"nixpkgs": [
"jj-cz",
"nixpkgs"
]
},
"locked": {
"lastModified": 1744324181,
"narHash": "sha256-Oi1n2ncF4/AWeY6X55o2FddIRICokbciqFYK64XorYk=",
"owner": "kamadorueda",
"repo": "alejandra",
"rev": "3e2a85506627062313e131bf8a85315f3387c8e0",
"type": "github"
},
"original": {
"owner": "kamadorueda",
"ref": "4.0.0",
"repo": "alejandra",
"type": "github"
}
},
"cachix": { "cachix": {
"inputs": { "inputs": {
"devenv": [ "devenv": [
@@ -33,6 +57,43 @@
"type": "github" "type": "github"
} }
}, },
"cachix_2": {
"inputs": {
"devenv": [
"jj-cz",
"devenv"
],
"flake-compat": [
"jj-cz",
"devenv",
"flake-compat"
],
"git-hooks": [
"jj-cz",
"devenv",
"git-hooks"
],
"nixpkgs": [
"jj-cz",
"devenv",
"nixpkgs"
]
},
"locked": {
"lastModified": 1760971495,
"narHash": "sha256-IwnNtbNVrlZIHh7h4Wz6VP0Furxg9Hh0ycighvL5cZc=",
"owner": "cachix",
"repo": "cachix",
"rev": "c5bfd933d1033672f51a863c47303fc0e093c2d2",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "latest",
"repo": "cachix",
"type": "github"
}
},
"caelestia-cli": { "caelestia-cli": {
"inputs": { "inputs": {
"caelestia-shell": [ "caelestia-shell": [
@@ -126,6 +187,56 @@
"type": "github" "type": "github"
} }
}, },
"devenv_2": {
"inputs": {
"cachix": "cachix_2",
"flake-compat": "flake-compat_2",
"flake-parts": "flake-parts_2",
"git-hooks": "git-hooks_2",
"nix": "nix_2",
"nixd": "nixd_2",
"nixpkgs": [
"jj-cz",
"nixpkgs"
]
},
"locked": {
"lastModified": 1770304289,
"narHash": "sha256-+g+XMyB1zi50h2N38GE32l7ZONX4oW7Nw6QSXzfNiwk=",
"owner": "cachix",
"repo": "devenv",
"rev": "fd777e39027d393346e4df672d51ad2bf44b2a12",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"fenix": {
"inputs": {
"nixpkgs": [
"jj-cz",
"alejandra",
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1730615655,
"narHash": "sha256-2HBR3zLn57LXKNRtxBb+O+uDqHM4n0pz51rPayMl4cg=",
"owner": "nix-community",
"repo": "fenix",
"rev": "efeb50e2535b17ffd4a135e6e3e5fd60a525180c",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
@@ -142,6 +253,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1761588595,
"narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@@ -163,6 +290,28 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"jj-cz",
"devenv",
"nixpkgs"
]
},
"locked": {
"lastModified": 1760948891,
"narHash": "sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "864599284fc7c0ba6357ed89ed5e2cd5040f0c04",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-root": { "flake-root": {
"locked": { "locked": {
"lastModified": 1723604017, "lastModified": 1723604017,
@@ -178,6 +327,21 @@
"type": "github" "type": "github"
} }
}, },
"flake-root_2": {
"locked": {
"lastModified": 1723604017,
"narHash": "sha256-rBtQ8gg+Dn4Sx/s+pvjdq3CB2wQNzx9XGFq/JVGCB6k=",
"owner": "srid",
"repo": "flake-root",
"rev": "b759a56851e10cb13f6b8e5698af7b59c44be26e",
"type": "github"
},
"original": {
"owner": "srid",
"repo": "flake-root",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1678901627, "lastModified": 1678901627,
@@ -211,6 +375,40 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_3": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flakeCompat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"git-hooks": { "git-hooks": {
"inputs": { "inputs": {
"flake-compat": [ "flake-compat": [
@@ -237,6 +435,34 @@
"type": "github" "type": "github"
} }
}, },
"git-hooks_2": {
"inputs": {
"flake-compat": [
"jj-cz",
"devenv",
"flake-compat"
],
"gitignore": "gitignore_2",
"nixpkgs": [
"jj-cz",
"devenv",
"nixpkgs"
]
},
"locked": {
"lastModified": 1760663237,
"narHash": "sha256-BflA6U4AM1bzuRMR8QqzPXqh8sWVCNDzOdsxXEguJIc=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "ca5b894d3e3e151ffc1db040b6ce4dcc75d31c37",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": { "gitignore": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -259,6 +485,29 @@
"type": "github" "type": "github"
} }
}, },
"gitignore_2": {
"inputs": {
"nixpkgs": [
"jj-cz",
"devenv",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -279,6 +528,30 @@
"type": "github" "type": "github"
} }
}, },
"jj-cz": {
"inputs": {
"alejandra": "alejandra",
"devenv": "devenv_2",
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1774310517,
"narHash": "sha256-0wvZ4TBJM0pigw2ix1TWFT9CIKpYZSVu7jQDyM4e1jA=",
"ref": "refs/heads/develop",
"rev": "dda4aae87caf35cf03d5b1ce0e172807fa987e5c",
"revCount": 27,
"type": "git",
"url": "https://labs.phundrak.com/phundrak/jj-cz"
},
"original": {
"type": "git",
"url": "https://labs.phundrak.com/phundrak/jj-cz"
}
},
"nix": { "nix": {
"inputs": { "inputs": {
"flake-compat": [ "flake-compat": [
@@ -339,6 +612,52 @@
"type": "github" "type": "github"
} }
}, },
"nix_2": {
"inputs": {
"flake-compat": [
"jj-cz",
"devenv",
"flake-compat"
],
"flake-parts": [
"jj-cz",
"devenv",
"flake-parts"
],
"git-hooks-nix": [
"jj-cz",
"devenv",
"git-hooks"
],
"nixpkgs": [
"jj-cz",
"devenv",
"nixpkgs"
],
"nixpkgs-23-11": [
"jj-cz",
"devenv"
],
"nixpkgs-regression": [
"jj-cz",
"devenv"
]
},
"locked": {
"lastModified": 1769708679,
"narHash": "sha256-uFKkp2/SjIqbu5HtINg/hwHN6qaqcxLIbL/om7dT3kI=",
"owner": "cachix",
"repo": "nix",
"rev": "72bec37fabbfe378d677868ec42eeb83acf07a4c",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "devenv-2.32",
"repo": "nix",
"type": "github"
}
},
"nixd": { "nixd": {
"inputs": { "inputs": {
"flake-parts": [ "flake-parts": [
@@ -366,6 +685,35 @@
"type": "github" "type": "github"
} }
}, },
"nixd_2": {
"inputs": {
"flake-parts": [
"jj-cz",
"devenv",
"flake-parts"
],
"flake-root": "flake-root_2",
"nixpkgs": [
"jj-cz",
"devenv",
"nixpkgs"
],
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
"lastModified": 1763964548,
"narHash": "sha256-JTRoaEWvPsVIMFJWeS4G2isPo15wqXY/otsiHPN0zww=",
"owner": "nix-community",
"repo": "nixd",
"rev": "d4bf15e56540422e2acc7bc26b20b0a0934e3f5e",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixd",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1772624091, "lastModified": 1772624091,
@@ -384,11 +732,11 @@
}, },
"pumo-system-info": { "pumo-system-info": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_3",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay_2"
}, },
"locked": { "locked": {
"lastModified": 1748984111, "lastModified": 1748984111,
@@ -431,6 +779,7 @@
"copyparty": "copyparty", "copyparty": "copyparty",
"devenv": "devenv", "devenv": "devenv",
"home-manager": "home-manager", "home-manager": "home-manager",
"jj-cz": "jj-cz",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"pumo-system-info": "pumo-system-info", "pumo-system-info": "pumo-system-info",
@@ -440,7 +789,45 @@
"zen-browser": "zen-browser" "zen-browser": "zen-browser"
} }
}, },
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1730555913,
"narHash": "sha256-KNHZUlqsEibg3YtfUyOFQSofP8hp1HKoY+laoesBxRM=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "f17a5bbfd0969ba2e63a74505a80e55ecb174ed9",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},
"rust-overlay": { "rust-overlay": {
"inputs": {
"nixpkgs": [
"jj-cz",
"nixpkgs"
]
},
"locked": {
"lastModified": 1770260791,
"narHash": "sha256-ADTBfENFjRVDQMcCycyX/pAy6NFI/Ct6Mrar3gsmXI0=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "42ec85352e419e601775c57256a52f6d48a39906",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_2": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"pumo-system-info", "pumo-system-info",
@@ -486,7 +873,7 @@
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"systems": "systems_2" "systems": "systems_3"
}, },
"locked": { "locked": {
"lastModified": 1772494187, "lastModified": 1772494187,
@@ -552,6 +939,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": { "treefmt-nix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -574,6 +976,29 @@
"type": "github" "type": "github"
} }
}, },
"treefmt-nix_2": {
"inputs": {
"nixpkgs": [
"jj-cz",
"devenv",
"nixd",
"nixpkgs"
]
},
"locked": {
"lastModified": 1734704479,
"narHash": "sha256-MMi74+WckoyEWBRcg/oaGRvXC9BVVxDZNRMpL+72wBI=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "65712f5af67234dad91a5a4baee986a8b62dbf8f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"zen-browser": { "zen-browser": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [

View File

@@ -29,6 +29,11 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
jj-cz = {
url = "git+https://labs.phundrak.com/phundrak/jj-cz";
inputs.nixpkgs.follows = "nixpkgs";
};
pumo-system-info = { pumo-system-info = {
url = "git+https://labs.phundrak.com/phundrak/pumo-system-info"; url = "git+https://labs.phundrak.com/phundrak/pumo-system-info";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";

View File

@@ -48,6 +48,10 @@ in {
enable = mkDefault true; enable = mkDefault true;
inherit (cfg) name email editor; inherit (cfg) name email editor;
signing.sshKey = mkDefault (cfg.publicKey.file or cfg.publicKey.content); signing.sshKey = mkDefault (cfg.publicKey.file or cfg.publicKey.content);
cz = {
enable = mkDefault true;
alias = mkDefault true;
};
}; };
}; };
} }

View File

@@ -2,10 +2,13 @@
lib, lib,
config, config,
pkgs, pkgs,
inputs,
... ...
}: }:
with lib; let with lib; let
inherit (pkgs.stdenv.hostPlatform) system;
cfg = config.home.dev.vcs.jj; cfg = config.home.dev.vcs.jj;
jj-cz = inputs.jj-cz.packages.${system}.default;
in { in {
options.home.dev.vcs.jj = { options.home.dev.vcs.jj = {
enable = mkEnableOption "enables jj"; enable = mkEnableOption "enables jj";
@@ -33,9 +36,15 @@ in {
description = "Path to the private SSH key for signing."; description = "Path to the private SSH key for signing.";
}; };
}; };
cz = {
enable = mkEnableOption "Enables jj-cz";
alias = mkEnableOption "Enable `jj cz` as an alias to `jj-cz`";
};
}; };
config.programs.jujutsu = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = mkIf cfg.cz.enable [jj-cz];
programs.jujutsu = {
enable = true; enable = true;
settings = { settings = {
user = { user = {
@@ -59,6 +68,7 @@ in {
aliases = { aliases = {
blame = ["file" "annotate"]; blame = ["file" "annotate"];
consume = ["squash" "--into" "@" "--from"]; consume = ["squash" "--into" "@" "--from"];
cz = mkIf cfg.cz.alias ["util" "exec" "--" "${jj-cz}/bin/jj-cz"];
eject = ["squash" "--from" "@" "--into"]; eject = ["squash" "--from" "@" "--into"];
d = ["diff"]; d = ["diff"];
dm = ["desc" "-m"]; dm = ["desc" "-m"];
@@ -112,4 +122,5 @@ in {
remotes.origin.auto-track-bookmarks = "*"; remotes.origin.auto-track-bookmarks = "*";
}; };
}; };
};
} }