From a87da58eaa3f866f2efd129f6751eb6e904ddfcf Mon Sep 17 00:00:00 2001 From: Anthony Cicchetti Date: Mon, 8 Jul 2024 09:54:11 -0400 Subject: [PATCH] Add custom starship config, updates --- nix/home-manager/flake.lock | 18 +++++----- .../modules/packages/starship.nix | 35 +++++++++++++++++++ 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/nix/home-manager/flake.lock b/nix/home-manager/flake.lock index 773455e..59b3e2a 100644 --- a/nix/home-manager/flake.lock +++ b/nix/home-manager/flake.lock @@ -29,11 +29,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1720333712, - "narHash": "sha256-qZmpIPUe4mwdBGmKPBJ5KzvXH6GOCXheiusTAgNjAAA=", + "lastModified": 1720420198, + "narHash": "sha256-OIuDb6pHDyGpo7YMFyuRzMLcHm7mRvlYOz0Ht7ps2sU=", "owner": "nix-community", "repo": "fenix", - "rev": "b78c98c53a46e2a2d6479a920f98aa0aeae56281", + "rev": "abc0549e3560189462a7d394cc9d50af4608d103", "type": "github" }, "original": { @@ -231,11 +231,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1720363800, - "narHash": "sha256-3EWJso8gLgZIFjxtg99zSK+0A4SQA4IHPxR5/2If47U=", + "lastModified": 1720442103, + "narHash": "sha256-onTR85U/vjMTERYsozU0mkhFGLmCKeW6hXMo+rJLnqw=", "owner": "nixOS", "repo": "nixpkgs", - "rev": "9f2c9d60f6915620cd5bc2a6c57908be3111b39e", + "rev": "566d3c2bf85f2aa86c73f23fc5e52fa8abcd96d5", "type": "github" }, "original": { @@ -318,11 +318,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1720292183, - "narHash": "sha256-CPcdVpsgmNXYVsw4nKPrM23J5mYXtiotYMz2BjPDIKU=", + "lastModified": 1720344064, + "narHash": "sha256-STmaV9Zu74QtkGGrbr9uMhskwagfCjJqOAYapXabiuk=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "058c88da66797eb588b47a4aac3e42847d1333d7", + "rev": "a5b21ea0aa644dffd7cf958b43f11f221d53404e", "type": "github" }, "original": { diff --git a/nix/home-manager/modules/packages/starship.nix b/nix/home-manager/modules/packages/starship.nix index 76dfab7..3469f2f 100644 --- a/nix/home-manager/modules/packages/starship.nix +++ b/nix/home-manager/modules/packages/starship.nix @@ -31,6 +31,41 @@ }; continuation_prompt = "→→"; + custom.jj = { + command = '' + jj log -r@ -l1 --ignore-working-copy --no-graph --color always -T ' + separate(" ", + branches.map(|x| if( + x.name().substr(0, 10).starts_with(x.name()), + x.name().substr(0, 10), + x.name().substr(0, 9) ++ "…") + ).join(" "), + tags.map(|x| if( + x.name().substr(0, 10).starts_with(x.name()), + x.name().substr(0, 10), + x.name().substr(0, 9) ++ "…") + ).join(" "), + surround("\"","\"", + if( + description.first_line().substr(0, 24).starts_with(description.first_line()), + description.first_line().substr(0, 24), + description.first_line().substr(0, 23) ++ "…" + ) + ), + if(conflict, "conflict"), + if(divergent, "divergent"), + if(hidden, "hidden"), + ) + ' + ''; + detect_folders = [".jj"]; + symbol = "jj"; + }; + custom.jjstatus = { + command = ''jj log -r@ -l1 --no-graph -T "" --stat | tail -n1 | sd "(\d+) files? changed, (\d+) insertions?\(\+\), (\d+) deletions?\(-\)" " $${1}m $${2}+ $${3}-" | sd " 0." ""''; + detect_folders = [".jj"]; + }; + dart = { symbol = " "; };