feat: use jj-starship
This commit is contained in:
parent
10ca6d6e8c
commit
77d8cf1b36
4 changed files with 51 additions and 3 deletions
|
|
@ -62,6 +62,8 @@
|
||||||
inputs.helix.overlays.default
|
inputs.helix.overlays.default
|
||||||
opencode.overlays.default
|
opencode.overlays.default
|
||||||
(final: prev: {
|
(final: prev: {
|
||||||
|
jj-starship = prev.callPackage ./pkgs/jj-starship.nix { };
|
||||||
|
|
||||||
# opencode's dev branch asks for Bun 1.3.14, but this revision builds and runs with nixpkgs' Bun 1.3.13.
|
# opencode's dev branch asks for Bun 1.3.14, but this revision builds and runs with nixpkgs' Bun 1.3.13.
|
||||||
opencode = prev.opencode.overrideAttrs (old: {
|
opencode = prev.opencode.overrideAttrs (old: {
|
||||||
postPatch = (old.postPatch or "") + ''
|
postPatch = (old.postPatch or "") + ''
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,7 @@ in
|
||||||
mkp224o
|
mkp224o
|
||||||
nixfmt
|
nixfmt
|
||||||
difftastic
|
difftastic
|
||||||
|
jj-starship
|
||||||
ripgrep
|
ripgrep
|
||||||
tea
|
tea
|
||||||
trash-cli
|
trash-cli
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.helix = {
|
programs.helix = {
|
||||||
|
|
@ -23,14 +23,19 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
enableBashIntegration = true;
|
enableBashIntegration = true;
|
||||||
settings = {
|
settings = {
|
||||||
format = "$directory$git_status$nix_shell$cmd_duration$line_break$character";
|
format = "$directory\${custom.jj}$nix_shell$cmd_duration$line_break$character";
|
||||||
directory.truncation_length = 3;
|
directory.truncation_length = 3;
|
||||||
git_status.style = "red";
|
|
||||||
git_branch.disabled = true;
|
git_branch.disabled = true;
|
||||||
|
git_status.disabled = true;
|
||||||
nix_shell.format = "[$symbol]($style) ";
|
nix_shell.format = "[$symbol]($style) ";
|
||||||
cmd_duration.min_time = 500;
|
cmd_duration.min_time = 500;
|
||||||
character.success_symbol = "[❯](bold green)";
|
character.success_symbol = "[❯](bold green)";
|
||||||
character.error_symbol = "[❯](bold red)";
|
character.error_symbol = "[❯](bold red)";
|
||||||
|
custom.jj = {
|
||||||
|
when = "jj-starship detect";
|
||||||
|
shell = [ "${pkgs.jj-starship}/bin/jj-starship" ];
|
||||||
|
format = "$output ";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
40
pkgs/jj-starship.nix
Normal file
40
pkgs/jj-starship.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
rustPlatform,
|
||||||
|
fetchFromGitHub,
|
||||||
|
pkg-config,
|
||||||
|
libgit2,
|
||||||
|
zlib,
|
||||||
|
versionCheckHook,
|
||||||
|
withGit ? true,
|
||||||
|
}:
|
||||||
|
|
||||||
|
rustPlatform.buildRustPackage (finalAttrs: {
|
||||||
|
pname = "jj-starship";
|
||||||
|
version = "0.7.1";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "dmmulroy";
|
||||||
|
repo = "jj-starship";
|
||||||
|
rev = "v${finalAttrs.version}";
|
||||||
|
hash = "sha256-NLds7i1ZmscicaNLmkZCWmc7A+367BXxGioRd4yYof8=";
|
||||||
|
};
|
||||||
|
|
||||||
|
cargoHash = "sha256-i7x/y+BkKH+Xj1bU4RRe9fcteabB+4uAgJuW3x5/jv4=";
|
||||||
|
buildNoDefaultFeatures = !withGit;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
|
||||||
|
buildInputs = [ zlib ] ++ lib.optionals withGit [ libgit2 ];
|
||||||
|
|
||||||
|
doInstallCheck = true;
|
||||||
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Unified Starship prompt module for Git and Jujutsu repositories that is optimized for latency";
|
||||||
|
homepage = "https://github.com/dmmulroy/jj-starship";
|
||||||
|
changelog = "https://github.com/dmmulroy/jj-starship/releases/tag/v${finalAttrs.version}";
|
||||||
|
license = lib.licenses.mit;
|
||||||
|
mainProgram = "jj-starship";
|
||||||
|
};
|
||||||
|
})
|
||||||
Loading…
Add table
Add a link
Reference in a new issue