diff --git a/flake.lock b/flake.lock index 76fce38..5876116 100644 --- a/flake.lock +++ b/flake.lock @@ -6,7 +6,7 @@ "llm-agents", "nixpkgs" ], - "systems": "systems" + "systems": "systems_2" }, "locked": { "lastModified": 1771437256, @@ -119,28 +119,6 @@ "type": "github" } }, - "fenix": { - "inputs": { - "nixpkgs": [ - "lumen", - "nixpkgs" - ], - "rust-analyzer-src": "rust-analyzer-src" - }, - "locked": { - "lastModified": 1768113825, - "narHash": "sha256-f09fAifGPEuRrz1DFY910jexq0DaBuQBbq7WcxQIUgs=", - "owner": "nix-community", - "repo": "fenix", - "rev": "55106e04d905c6a7726d0f6be77ed39a99f66a61", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "fenix", - "type": "github" - } - }, "flake-compat": { "flake": false, "locked": { @@ -213,7 +191,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_2" + "systems": "systems" }, "locked": { "lastModified": 1731533236, @@ -299,10 +277,45 @@ "type": "github" } }, + "jj-ryu": { + "flake": false, + "locked": { + "lastModified": 1769803702, + "narHash": "sha256-gE4lvqyC2LRAWNDUGePklORWjyEofs/dHLHVBAub424=", + "owner": "dmmulroy", + "repo": "jj-ryu", + "rev": "aade8d5acb9c2411828f38049a9b42a4b14529b8", + "type": "github" + }, + "original": { + "owner": "dmmulroy", + "repo": "jj-ryu", + "type": "github" + } + }, + "jj-starship": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1769370163, + "narHash": "sha256-YfcFlJsPCRfqhN+3JUWE77c+eHIp5RAu2rq/JhSxCec=", + "owner": "dmmulroy", + "repo": "jj-starship", + "rev": "76cf00619b0cce5bd08a1b9a49b310ed928794d5", + "type": "github" + }, + "original": { + "owner": "dmmulroy", + "repo": "jj-starship", + "type": "github" + } + }, "llm-agents": { "inputs": { "blueprint": "blueprint", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "treefmt-nix": "treefmt-nix" }, "locked": { @@ -319,28 +332,6 @@ "type": "github" } }, - "lumen": { - "inputs": { - "fenix": "fenix", - "flake-utils": "flake-utils_2", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1769947964, - "narHash": "sha256-DElM5gwipT82puD7w5KMxG3PGiwozJ2VVXtwwPbwV5g=", - "owner": "jnsahaj", - "repo": "lumen", - "rev": "af5fa88eba126dc4508ddd307fd0a2c78f77c898", - "type": "github" - }, - "original": { - "owner": "jnsahaj", - "repo": "lumen", - "type": "github" - } - }, "nix-github-actions": { "inputs": { "nixpkgs": [ @@ -382,11 +373,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1771423170, - "narHash": "sha256-K7Dg9TQ0mOcAtWTO/FX/FaprtWQ8BmEXTpLIaNRhEwU=", + "lastModified": 1766840161, + "narHash": "sha256-Ss/LHpJJsng8vz1Pe33RSGIWUOcqM1fjrehjUkdrWio=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bcc4a9d9533c033d806a46b37dc444f9b0da49dd", + "rev": "3edc4a30ed3903fdf6f90c837f961fa6b49582d1", "type": "github" }, "original": { @@ -412,6 +403,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1771423170, + "narHash": "sha256-K7Dg9TQ0mOcAtWTO/FX/FaprtWQ8BmEXTpLIaNRhEwU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "bcc4a9d9533c033d806a46b37dc444f9b0da49dd", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1772370856, "narHash": "sha256-OXf9tB+s1EPCzIBR4eIQTm1dbbfVgjPNEGChgwEvvIU=", @@ -427,7 +434,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1770380644, "narHash": "sha256-P7dWMHRUWG5m4G+06jDyThXO7kwSk46C1kgjEWcybkE=", @@ -443,7 +450,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1765934234, "narHash": "sha256-pJjWUzNnjbIAMIc5gRFUuKCDQ9S1cuh3b2hKgA7Mc4A=", @@ -462,7 +469,7 @@ "nixvim": { "inputs": { "flake-parts": "flake-parts_2", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "systems": "systems_3" }, "locked": { @@ -504,33 +511,17 @@ "home-manager": "home-manager", "homebrew-cask": "homebrew-cask", "homebrew-core": "homebrew-core", + "jj-ryu": "jj-ryu", + "jj-starship": "jj-starship", "llm-agents": "llm-agents", - "lumen": "lumen", "nix-homebrew": "nix-homebrew", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "nixvim": "nixvim", "overseer": "overseer", "sops-nix": "sops-nix", "zjstatus": "zjstatus" } }, - "rust-analyzer-src": { - "flake": false, - "locked": { - "lastModified": 1768083390, - "narHash": "sha256-TGWPJq2mXwxfAe83iZ18DIqXC4sOSj7RkW9b59h6Ox4=", - "owner": "rust-lang", - "repo": "rust-analyzer", - "rev": "e42e8ff582ba12a88b6845525d08b6428e6d0fb9", - "type": "github" - }, - "original": { - "owner": "rust-lang", - "ref": "nightly", - "repo": "rust-analyzer", - "type": "github" - } - }, "rust-overlay": { "inputs": { "nixpkgs": [ @@ -673,7 +664,7 @@ "inputs": { "crane": "crane", "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "rust-overlay": "rust-overlay" }, "locked": { diff --git a/flake.nix b/flake.nix index 50fbb13..00deb2d 100644 --- a/flake.nix +++ b/flake.nix @@ -36,10 +36,11 @@ url = "github:zhaofengli/colmena"; inputs.nixpkgs.follows = "nixpkgs"; }; - lumen = { - url = "github:jnsahaj/lumen"; - inputs.nixpkgs.follows = "nixpkgs"; + jj-ryu = { + url = "github:dmmulroy/jj-ryu"; + flake = false; }; + jj-starship.url = "github:dmmulroy/jj-starship"; overseer = { url = "github:dmmulroy/overseer"; flake = false; diff --git a/hosts/chidi/default.nix b/hosts/chidi/default.nix index 5f4440b..d7a0458 100644 --- a/hosts/chidi/default.nix +++ b/hosts/chidi/default.nix @@ -30,8 +30,9 @@ ../../profiles/ghostty.nix ../../profiles/git.nix ../../profiles/home.nix + ../../profiles/jjui.nix + ../../profiles/jujutsu.nix ../../profiles/lazygit.nix - ../../profiles/lumen.nix ../../profiles/mise.nix ../../profiles/neovim ../../profiles/opencode.nix diff --git a/hosts/jason/default.nix b/hosts/jason/default.nix index b80a828..fbc1327 100644 --- a/hosts/jason/default.nix +++ b/hosts/jason/default.nix @@ -29,8 +29,9 @@ ../../profiles/ghostty.nix ../../profiles/git.nix ../../profiles/home.nix + ../../profiles/jjui.nix + ../../profiles/jujutsu.nix ../../profiles/lazygit.nix - ../../profiles/lumen.nix ../../profiles/mise.nix ../../profiles/neovim ../../profiles/opencode.nix diff --git a/hosts/tahani/default.nix b/hosts/tahani/default.nix index 28ef272..fa9e67d 100644 --- a/hosts/tahani/default.nix +++ b/hosts/tahani/default.nix @@ -30,8 +30,9 @@ ../../profiles/fzf.nix ../../profiles/git.nix ../../profiles/home.nix + ../../profiles/jjui.nix + ../../profiles/jujutsu.nix ../../profiles/lazygit.nix - ../../profiles/lumen.nix ../../profiles/mise.nix ../../profiles/neovim ../../profiles/opencode.nix diff --git a/overlays/jj-ryu.nix b/overlays/jj-ryu.nix new file mode 100644 index 0000000..a9acba5 --- /dev/null +++ b/overlays/jj-ryu.nix @@ -0,0 +1,7 @@ +{inputs}: final: prev: { + jj-ryu = + import ../lib/build-rust-package.nix { + inherit prev; + input = inputs.jj-ryu; + }; +} diff --git a/overlays/jj-starship.nix b/overlays/jj-starship.nix new file mode 100644 index 0000000..3485dbf --- /dev/null +++ b/overlays/jj-starship.nix @@ -0,0 +1 @@ +{inputs}: inputs.jj-starship.overlays.default diff --git a/profiles/jjui.nix b/profiles/jjui.nix new file mode 100644 index 0000000..5a6277d --- /dev/null +++ b/profiles/jjui.nix @@ -0,0 +1,5 @@ +{ + programs.jjui = { + enable = true; + }; +} diff --git a/profiles/jujutsu.nix b/profiles/jujutsu.nix new file mode 100644 index 0000000..14bb922 --- /dev/null +++ b/profiles/jujutsu.nix @@ -0,0 +1,60 @@ +{ + programs.jujutsu = { + enable = true; + settings = { + user = { + name = "Christoph Schmatzler"; + email = "christoph@schmatzler.com"; + }; + git = { + sign-on-push = true; + subprocess = true; + write-change-id-header = true; + private-commits = "description(glob:'wip:*') | description(glob:'WIP:*') | description(exact:'')"; + }; + fsmonitor = { + backend = "watchman"; + }; + ui = { + default-command = "status"; + diff-formatter = ":git"; + pager = ["delta" "--pager" "less -FRX"]; + diff-editor = ["nvim" "-c" "DiffEditor $left $right $output"]; + movement = { + edit = true; + }; + }; + aliases = { + n = ["new"]; + tug = ["bookmark" "move" "--from" "closest_bookmark(@-)" "--to" "@-"]; + stack = ["log" "-r" "stack()"]; + retrunk = ["rebase" "-d" "trunk()"]; + bm = ["bookmark"]; + gf = ["git" "fetch"]; + gp = ["git" "push"]; + }; + revset-aliases = { + "closest_bookmark(to)" = "heads(::to & bookmarks())"; + "closest_pushable(to)" = "heads(::to & mutable() & ~description(exact:\"\") & (~empty() | merges()))"; + "mine()" = "author(\"christoph@schmatzler.com\")"; + "wip()" = "mine() ~ immutable()"; + "open()" = "mine() ~ ::trunk()"; + "current()" = "@:: & mutable()"; + "stack()" = "reachable(@, mutable())"; + }; + templates = { + draft_commit_description = '' + concat( + coalesce(description, default_commit_description, "\n"), + surround( + "\nJJ: This commit contains the following changes:\n", "", + indent("JJ: ", diff.stat(72)), + ), + "\nJJ: ignore-rest\n", + diff.git(), + ) + ''; + }; + }; + }; +} diff --git a/profiles/neovim/default.nix b/profiles/neovim/default.nix index 6bcf7cf..3992123 100644 --- a/profiles/neovim/default.nix +++ b/profiles/neovim/default.nix @@ -8,6 +8,7 @@ ./plugins/grug-far.nix ./plugins/harpoon.nix ./plugins/hunk.nix + ./plugins/jj-diffconflicts.nix ./plugins/lsp.nix ./plugins/mini.nix ./plugins/oil.nix diff --git a/profiles/neovim/mappings.nix b/profiles/neovim/mappings.nix index 2397757..a07df9a 100644 --- a/profiles/neovim/mappings.nix +++ b/profiles/neovim/mappings.nix @@ -118,15 +118,21 @@ options.desc = "Visit paths (cwd)"; } # g - git + { + mode = "n"; + key = "gc"; + action = ":JJDiffConflicts"; + options.desc = "Resolve conflicts"; + } { mode = "n"; key = "gg"; action.__raw = '' - function() - require('toggleterm.terminal').Terminal:new({ cmd = 'lazygit', direction = 'float' }):toggle() - end + function() + require('toggleterm.terminal').Terminal:new({ cmd = 'jjui', direction = 'float' }):toggle() + end ''; - options.desc = "lazygit"; + options.desc = "jjui"; } # l - lsp/formatter { diff --git a/profiles/neovim/plugins/jj-diffconflicts.nix b/profiles/neovim/plugins/jj-diffconflicts.nix new file mode 100644 index 0000000..e65c100 --- /dev/null +++ b/profiles/neovim/plugins/jj-diffconflicts.nix @@ -0,0 +1,14 @@ +{pkgs, ...}: { + programs.nixvim.extraPlugins = [ + (pkgs.vimUtils.buildVimPlugin { + name = "jj-diffconflicts"; + src = + pkgs.fetchFromGitHub { + owner = "rafikdraoui"; + repo = "jj-diffconflicts"; + rev = "main"; + hash = "sha256-hvMXpslucywVYA9Sdxx6IcXQXYcYNWK8s9jr+KtStdI="; + }; + }) + ]; +} diff --git a/profiles/packages.nix b/profiles/packages.nix index 5672130..6997fda 100644 --- a/profiles/packages.nix +++ b/profiles/packages.nix @@ -28,6 +28,8 @@ with pkgs; hledger htop hyperfine + jj-ryu + jj-starship jq killall lsof diff --git a/profiles/starship.nix b/profiles/starship.nix index bba4326..cb8db12 100644 --- a/profiles/starship.nix +++ b/profiles/starship.nix @@ -5,7 +5,7 @@ settings = { add_newline = true; command_timeout = 2000; - format = "$directory$git_branch$git_status$character"; + format = "$directory$git_branch$git_status$\{custom.scm}$character"; character = { error_symbol = "[✗ ](bold #e64553)"; success_symbol = "[❯](bold #40a02b)[❯](bold #df8e1d)[❯](bold #dc8a78)"; @@ -37,6 +37,11 @@ renamed = "mv:$count "; deleted = "del:$count "; }; + custom.scm = { + when = "jj-starship detect"; + shell = ["jj-starship" "--strip-bookmark-prefix" "cschmatzler/" "--truncate-name" "20" "--bookmarks-display-limit" "1"]; + format = "$output "; + }; }; }; }