Skip to content

Instantly share code, notes, and snippets.

@frederikstroem
Created April 20, 2025 05:11
Show Gist options
  • Save frederikstroem/0784a23a10d2fafcf920ed471e31b4d3 to your computer and use it in GitHub Desktop.
Save frederikstroem/0784a23a10d2fafcf920ed471e31b4d3 to your computer and use it in GitHub Desktop.
[2025-04-20 snapshot] Starship custom command for Nushell's Directory Stack (`dirs` module).
{ config, pkgs, ... }:
{
programs.starship = {
enable = true;
settings = {
custom = {
nu_dirs = {
disabled = false;
description = "Nushell `dirs` module";
shell = [ "nu" "-c" ];
when = "use std/dirs;if not ((dirs | length) > 1) { exit 1 }";
command = "use std/dirs;dirs | length";
symbol = "๐Ÿ“‚ ";
# format = "[$symbol$output]($style) ";
style = "bold yellow";
use_stdin = false;
# unsafe_no_escape = true;
};
};
};
};
}
[custom.nu_dirs]
command = "use std/dirs;dirs | length"
description = "Nushell `dirs` module"
disabled = false
shell = ["nu", "-c"]
style = "bold yellow"
symbol = "๐Ÿ“‚ "
use_stdin = false
when = "use std/dirs;if not ((dirs | length) > 1) { exit 1 }"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment