From 7a8e7ca9d709d2895075878fffc2c913ffe8713a Mon Sep 17 00:00:00 2001 From: imxyy_soope_ Date: Sat, 20 Dec 2025 12:57:47 +0800 Subject: [PATCH] feat(pkgs): jj-starship --- modules/cli/vcs/jj.nix | 4 +++- pkgs/default.nix | 3 +++ pkgs/jj-starship.nix | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 pkgs/jj-starship.nix diff --git a/modules/cli/vcs/jj.nix b/modules/cli/vcs/jj.nix index 2deaaa6..5ac2615 100644 --- a/modules/cli/vcs/jj.nix +++ b/modules/cli/vcs/jj.nix @@ -16,9 +16,9 @@ in }; config = lib.mkIf cfg.enable { - my.hm.programs.jujutsu.enable = true; my.hm = { programs.jujutsu = { + enable = true; settings = { user = { name = "${userfullname}"; @@ -48,6 +48,8 @@ in jj = { ignore_timeout = true; description = "The current jj status"; + # when = "${lib.getExe pkgs.jj-starship} detect"; + # command = "${lib.getExe pkgs.jj-starship}"; when = true; command = '' jj log --revisions @ --no-graph --ignore-working-copy --color always --limit 1 --template ' diff --git a/pkgs/default.nix b/pkgs/default.nix index 415235c..5f51ac6 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -46,10 +46,13 @@ final: prev: let paths = [ + # keep-sorted start ./fcitx5-lightly + ./jj-starship.nix ./mono-gtk-theme.nix ./ttf-wps-fonts.nix ./wps-office-fonts.nix + # keep-sorted end ]; in builtins.listToAttrs ( diff --git a/pkgs/jj-starship.nix b/pkgs/jj-starship.nix new file mode 100644 index 0000000..3e2def1 --- /dev/null +++ b/pkgs/jj-starship.nix @@ -0,0 +1,18 @@ +{ fetchFromGitHub, rustPlatform }: +rustPlatform.buildRustPackage (finalAttrs: { + pname = "jj-starship"; + version = "0.2.1"; + + src = fetchFromGitHub { + owner = "dmmulroy"; + repo = finalAttrs.pname; + tag = "v${finalAttrs.version}"; + hash = "sha256-wmQn1qw+jfxH9xBS7bdgWiK369bCeGV9klZzlFHrGOw="; + }; + + cargoHash = "sha256-dGutKgOG0gPDYcTODrBUmmJBl2k437E5/lz+9cFzgs4="; + + meta = { + mainProgram = "jj-starship"; + }; +})