nushell and prompt play
This commit is contained in:
parent
8f62ae3202
commit
4f7d109a37
5 changed files with 82 additions and 27 deletions
42
flake.lock
generated
42
flake.lock
generated
|
@ -137,11 +137,11 @@
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751361224,
|
"lastModified": 1751447566,
|
||||||
"narHash": "sha256-x7+c5lFhoZapaQGvkyExaF8mt5u29+4l0DJwQWUspH4=",
|
"narHash": "sha256-PD6SIXio6A44d0BjfUYPUyC9SyHnGcQP5N/ceoGJsno=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "emacs-overlay",
|
"repo": "emacs-overlay",
|
||||||
"rev": "6ab8bb6826895f1ac82366eddeed184a69729e5a",
|
"rev": "6b5c9e8d4cfe157a398aedf877ad6fbb71c6bca6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -541,11 +541,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751384836,
|
"lastModified": 1751463936,
|
||||||
"narHash": "sha256-7xRbl/VLXxE5DzJmk1wdKWJmPx8rAfNC/a6mXtqp5cc=",
|
"narHash": "sha256-kS8p1QgyFO/95BHSsZMpBs8oRh1bklAd/zzpWhF6ODk=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "479f8889675770881033878a1c114fbfc6de7a4d",
|
"rev": "3d243d4a16cafe855df585b3030aa99261a27a86",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -832,11 +832,11 @@
|
||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751379130,
|
"lastModified": 1751432711,
|
||||||
"narHash": "sha256-TObxiGbuX/4FbOnzDRvznfMUjIgS+d71+BetT35EOB8=",
|
"narHash": "sha256-136MeWtckSHTN9Z2WRNRdZ8oRP3vyx3L8UxeBYE+J9w=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "8b1f894089789eb39eacf0d6891d1e17cc3a84ab",
|
"rev": "497ae1357f1ac97f1aea31a4cb74ad0d534ef41f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -908,11 +908,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-stable": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751048012,
|
"lastModified": 1751274312,
|
||||||
"narHash": "sha256-MYbotu4UjWpTsq01wglhN5xDRfZYLFtNk7SBY0BcjkU=",
|
"narHash": "sha256-/bVBlRpECLVzjV19t5KMdMFWSwKLtb5RyXdjz3LJT+g=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a684c58d46ebbede49f280b653b9e56100aa3877",
|
"rev": "50ab793786d9de88ee30ec4e4c24fb4236fc2674",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1036,11 +1036,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_7": {
|
"nixpkgs_7": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1748460289,
|
"lastModified": 1751011381,
|
||||||
"narHash": "sha256-7doLyJBzCllvqX4gszYtmZUToxKvMUrg45EUWaUYmBg=",
|
"narHash": "sha256-krGXKxvkBhnrSC/kGBmg5MyupUUT5R6IBCLEzx9jhMM=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "96ec055edbe5ee227f28cdbc3f1ddf1df5965102",
|
"rev": "30e2e2857ba47844aa71991daa6ed1fc678bcbb7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1453,11 +1453,11 @@
|
||||||
"nixpkgs": "nixpkgs_7"
|
"nixpkgs": "nixpkgs_7"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751383914,
|
"lastModified": 1751446291,
|
||||||
"narHash": "sha256-v+lQnPqTUVuo/aL8pZ5kJWo9VwWUjlGTenq4FXRzYYY=",
|
"narHash": "sha256-CbvStVJ0bzrIHh2CkaM2epMB1AoTJMAw+Mx/ORJTOdY=",
|
||||||
"owner": "Alexays",
|
"owner": "Alexays",
|
||||||
"repo": "Waybar",
|
"repo": "Waybar",
|
||||||
"rev": "88766de1ee496c57af3823557c43d435ced3daa1",
|
"rev": "f409f53131b3061a4c8f08f3a39abe1e3417ff4b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1599,11 +1599,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751383329,
|
"lastModified": 1751440815,
|
||||||
"narHash": "sha256-52dUY8jEkuXEIZINYb+AVsrmw6FxMhBAG3K9J/2qiSo=",
|
"narHash": "sha256-cBEcG90ahVVPMKEHiyn13KT7cxpcEwSOqrLhgz5/M9k=",
|
||||||
"owner": "0xc000022070",
|
"owner": "0xc000022070",
|
||||||
"repo": "zen-browser-flake",
|
"repo": "zen-browser-flake",
|
||||||
"rev": "f29a4fece3b76c3e4579d67e2cf0cb8037f6a351",
|
"rev": "a37c444f51b3e7df8ea3333c57a4154c6b09dc39",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -212,6 +212,7 @@
|
||||||
greetd-password.enableGnomeKeyring = true;
|
greetd-password.enableGnomeKeyring = true;
|
||||||
niri.enableGnomeKeyring = true;
|
niri.enableGnomeKeyring = true;
|
||||||
swaylock.enableGnomeKeyring = true;
|
swaylock.enableGnomeKeyring = true;
|
||||||
|
swayidle.enableGnomeKeyring = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
|
|
||||||
$env.config.completions.external.completer = $fish_completer
|
$env.config.completions.external.completer = $fish_completer
|
||||||
$env.LS_COLORS = (vivid generate one-dark)
|
$env.LS_COLORS = (vivid generate one-dark)
|
||||||
|
$env.TRANSIENT_PROMPT_COMMAND = ^starship module character
|
||||||
|
$env.TRANSIENT_PROMPT_INDICATOR = ""
|
||||||
|
$env.TRANSIENT_PROMPT_INDICATOR_VI_INSERT = ""
|
||||||
|
$env.TRANSIENT_PROMPT_INDICATOR_VI_NORMAL = ""
|
||||||
|
$env.TRANSIENT_PROMPT_MULTILINE_INDICATOR = ""
|
||||||
|
$env.TRANSIENT_PROMPT_COMMAND_RIGHT = ^starship module time
|
||||||
|
|
||||||
def --env doomup [...args] {
|
def --env doomup [...args] {
|
||||||
doom sync ...$args
|
doom sync ...$args
|
||||||
|
@ -9,7 +15,7 @@ def --env doomup [...args] {
|
||||||
}
|
}
|
||||||
|
|
||||||
def --env lla [...args] {
|
def --env lla [...args] {
|
||||||
ls -alm ...$args | select name size type mode
|
ls -alm ...$args | select name type size modified mode user group
|
||||||
}
|
}
|
||||||
|
|
||||||
# def --env pullall [] {
|
# def --env pullall [] {
|
||||||
|
@ -19,3 +25,40 @@ def --env lla [...args] {
|
||||||
def pdf-compress [...args] {
|
def pdf-compress [...args] {
|
||||||
gs -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -dNOPAUSE -dBATCH -sOutputFile=output.pdf $args
|
gs -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -dNOPAUSE -dBATCH -sOutputFile=output.pdf $args
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def nh-switch-gc [...args] {
|
||||||
|
nh os switch; nh clean all --keep 3 --nogcroots; nix store optimise;
|
||||||
|
}
|
||||||
|
|
||||||
|
def "nu-complete zoxide path" [context: string] {
|
||||||
|
let parts = $context | str trim --left | split row " " | skip 1 | each { str downcase }
|
||||||
|
let completions = (
|
||||||
|
^zoxide query --list --exclude $env.PWD -- ...$parts
|
||||||
|
| lines
|
||||||
|
| each { |dir|
|
||||||
|
if ($parts | length) <= 1 {
|
||||||
|
$dir
|
||||||
|
} else {
|
||||||
|
let dir_lower = $dir | str downcase
|
||||||
|
let rem_start = $parts | drop 1 | reduce --fold 0 { |part, rem_start|
|
||||||
|
($dir_lower | str index-of --range $rem_start.. $part) + ($part | str length)
|
||||||
|
}
|
||||||
|
{
|
||||||
|
value: ($dir | str substring $rem_start..),
|
||||||
|
description: $dir
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
{
|
||||||
|
options: {
|
||||||
|
sort: false,
|
||||||
|
completion_algorithm: substring,
|
||||||
|
case_sensitive: false,
|
||||||
|
},
|
||||||
|
completions: $completions,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def --env --wrapped z [...rest: string@"nu-complete zoxide path"] {
|
||||||
|
__zoxide_z ...$rest
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
nu_scripts
|
||||||
|
];
|
||||||
|
|
||||||
programs.nushell = {
|
programs.nushell = {
|
||||||
enable = true;
|
enable = true;
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
|
|
|
@ -1,14 +1,21 @@
|
||||||
"$schema" = 'https://starship.rs/config-schema.json'
|
"$schema" = 'https://starship.rs/config-schema.json'
|
||||||
|
|
||||||
format = "$env_var$all$line_break$character"
|
format = "$env_var$shell$all$line_break$character"
|
||||||
|
right_format = ""
|
||||||
|
|
||||||
|
[shell]
|
||||||
|
fish_indicator = ' '
|
||||||
|
nu_indicator = 'nu'
|
||||||
|
style = "#aaaaaa"
|
||||||
|
format = '[$indicator ]($style) '
|
||||||
|
disabled = false
|
||||||
|
|
||||||
[env_var.yazi_level]
|
[env_var.yazi_level]
|
||||||
description = "Indicate the shell was launched by `yazi`"
|
description = "Indicate the shell was launched by `yazi`"
|
||||||
variable = "YAZI_LEVEL"
|
variable = "YAZI_LEVEL"
|
||||||
# 🦆: U+1f986 Duck
|
symbol = ""
|
||||||
# Alternatively: " ": U+E795 <Private Use>
|
style = "yellow"
|
||||||
symbol = "🦆"
|
format = '[$symbol ]($style)'
|
||||||
format = '[ $symbol ]($style)'
|
|
||||||
|
|
||||||
[directory]
|
[directory]
|
||||||
truncation_length = 0
|
truncation_length = 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue