lots of nushell updates, kanata, and more

This commit is contained in:
Matt Nish-Lapidus 2025-07-07 14:20:00 -04:00
parent b448e6a6a2
commit 3b5ace5e79
7 changed files with 77 additions and 64 deletions

42
flake.lock generated
View file

@ -93,11 +93,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1751607816, "lastModified": 1751854533,
"narHash": "sha256-5PtrwjqCIJ4DKQhzYdm8RFePBuwb+yTzjV52wWoGSt4=", "narHash": "sha256-U/OQFplExOR1jazZY4KkaQkJqOl59xlh21HP9mI79Vc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "da6109c917b48abc1f76dd5c9bf3901c8c80f662", "rev": "16b74a1e304197248a1bc663280f2548dbfcae3c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -153,11 +153,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1751819016, "lastModified": 1751908357,
"narHash": "sha256-VUH2XRvstd/AQmph85qMOrSuDdhE6Wi0NIbpWtl2j58=", "narHash": "sha256-7JeYhMYTdfzHsFfGZRUM+t0nx4HdYa3oaMH2B/qz9MA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "b36094ff60e3b8e3d8cda96f2824bd57bbf32d93", "rev": "8e4ecd7c43c5e061dd2fc4d9d1994ec4d67cab2e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -644,11 +644,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1751816429, "lastModified": 1751824240,
"narHash": "sha256-F9xzryA4OfrGTQS1N8SimJQzoD8qDMj/e2lTFE9V288=", "narHash": "sha256-aDDC0CHTlL7QDKWWhdbEgVPK6KwWt+ca0QkmHYZxMzI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "b4486ff44addd453a64fd8c176ab2fd7ad3f6eb3", "rev": "fd9e55f5fac45a26f6169310afca64d56b681935",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1073,11 +1073,11 @@
"xwayland-satellite-unstable": "xwayland-satellite-unstable" "xwayland-satellite-unstable": "xwayland-satellite-unstable"
}, },
"locked": { "locked": {
"lastModified": 1751815493, "lastModified": 1751866241,
"narHash": "sha256-tF7Tery/v0lhBKAwj9TgBLPSng42iZzlf/MeFb7on6U=", "narHash": "sha256-9UJmOYKYXx/hrXTAtFCJtlrIRQmuRLQ+IKj9eTeFIXc=",
"owner": "sodiboo", "owner": "sodiboo",
"repo": "niri-flake", "repo": "niri-flake",
"rev": "c4d9d4caa0c1e5c002679ca4b15db223b1942c2b", "rev": "59e74c8ac38b131d664a667e046861bd72f5b651",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1438,11 +1438,11 @@
}, },
"nixpkgs_7": { "nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1751637120, "lastModified": 1751792365,
"narHash": "sha256-xVNy/XopSfIG9c46nRmPaKfH1Gn/56vQ8++xWA8itO4=", "narHash": "sha256-J1kI6oAj25IG4EdVlg2hQz8NZTBNYvIS0l4wpr9KcUo=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "5c724ed1388e53cc231ed98330a60eb2f7be4be3", "rev": "1fd8bada0b6117e6c7eb54aad5813023eed37ccb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -2147,11 +2147,11 @@
"rust-overlay": "rust-overlay_4" "rust-overlay": "rust-overlay_4"
}, },
"locked": { "locked": {
"lastModified": 1751812076, "lastModified": 1751895895,
"narHash": "sha256-h7vE7KQvHIPaPik7Ze818dy/G4YQRWVFqNyxqcBAEwI=", "narHash": "sha256-kJB7D+62dqdPzuBgqD5tYnk0KpqkGZFZr2KB+5RFqp8=",
"owner": "sxyazi", "owner": "sxyazi",
"repo": "yazi", "repo": "yazi",
"rev": "917e1f54a10445f2e25147c4b81a3c77d8233632", "rev": "5f7c0e813f25a55da90779ec98934e2ed94a5737",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -2168,11 +2168,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1751779188, "lastModified": 1751858709,
"narHash": "sha256-o1PidAPLtSSqI6isos6v/e6s7t3zQ56NBYhXVaUesXc=", "narHash": "sha256-xghd1GDPRSa6aD6tEk2JCuQDZWdHITlCA/stwSVoZJQ=",
"owner": "0xc000022070", "owner": "0xc000022070",
"repo": "zen-browser-flake", "repo": "zen-browser-flake",
"rev": "b3200f40877a3e0a679070d96f8793a06105c06e", "rev": "216dd333fa41aa013bf8aab9322d7c1a2aee5b4a",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -352,8 +352,7 @@ in
"Mod+Shift+A" = { "Mod+Shift+A" = {
hotkey-overlay.title = "Lock Session"; hotkey-overlay.title = "Lock Session";
action = spawn "/home/emenel/.local/bin/session-lock"; action = spawn "${pkgs.systemd}/bin/loginctl" "lock-session";
allow-when-locked = true;
}; };
"XF86AudioPlay" = { "XF86AudioPlay" = {

View file

@ -183,6 +183,31 @@
}; };
gitui = { gitui = {
enable = true; enable = true;
theme = ''
(
selected_tab: Reset,
command_fg: Black,
selection_bg: Blue,
selection_fg: White,
cmdbar_bg: Blue,
cmdbar_extra_lines_bg: Blue,
disabled_fg: DarkGray,
diff_line_add: Green,
diff_line_delete: Red,
diff_file_added: LightGreen,
diff_file_removed: LightRed,
diff_file_moved: LightMagenta,
diff_file_modified: Yellow,
commit_hash: Magenta,
commit_time: LightCyan,
commit_author: Green,
danger_fg: Red,
push_gauge_bg: Blue,
push_gauge_fg: Reset,
tag_fg: LightMagenta,
branch_fg: LightYellow,
)
'';
}; };
}; };

View file

@ -8,6 +8,8 @@ $env.LS_COLORS = (vivid generate one-dark)
# $env.TRANSIENT_PROMPT_MULTILINE_INDICATOR = "" # $env.TRANSIENT_PROMPT_MULTILINE_INDICATOR = ""
# $env.TRANSIENT_PROMPT_COMMAND_RIGHT = ^starship module time # $env.TRANSIENT_PROMPT_COMMAND_RIGHT = ^starship module time
alias "nuls" = ls
def --env nufzf [] {$in | each {|i| $i | to json --raw} | str join "\n" | fzf | from json} def --env nufzf [] {$in | each {|i| $i | to json --raw} | str join "\n" | fzf | from json}
def --env doomup [...args] { def --env doomup [...args] {
@ -16,11 +18,19 @@ def --env doomup [...args] {
systemctl --user restart emacs.service systemctl --user restart emacs.service
} }
def --env lla [...pattern: glob] { # TODO: is there a way to passthrough args?
let pattern = if ($pattern | is-empty) { [ '.' ] } else { $pattern } def --env ls [...p: glob] {
nuls -alm $pattern | select name type size modified mode user let pattern = if ($p | is-empty) { [ '.' ] } else { $p }
nuls -lm ...$pattern | select name size modified mode user
} }
def --env lla [...p: glob] {
let pattern = if ($p | is-empty) { [ '.' ] } else { $p }
nuls -alm ...$pattern | select name size modified mode user
}
alias "ll" = lla
# def --env pullall [] { # def --env pullall [] {
# } # }
@ -32,36 +42,3 @@ def pdf-compress [...args] {
def nh-switch-gc [...args] { def nh-switch-gc [...args] {
nh os switch; nh clean all --keep 3 --nogcroots; nix store optimise; 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
}

View file

@ -17,3 +17,18 @@
$completions $completions
} }
} }
let zoxide_completer = {|spans|
$spans | skip 1 | zoxide query -l ...$in | lines | each {|line| $line | str replace $env.HOME '~' } | where {|x| $x != $env.PWD}
}
let external_completer = {|spans|
match $spans.0 {
# use zoxide completions for zoxide commands
z | zi => $zoxide_completer
__zoxide_z | __zoxide_zi => $zoxide_completer
_ => $fish_completer
} | do $in $spans
}

View file

@ -8,10 +8,6 @@
programs.nushell = { programs.nushell = {
enable = true; enable = true;
shellAliases = { shellAliases = {
"nuls" = "ls";
"ls" = "ls -m";
"ll" = "ls -m";
"la" = "ls -am";
"lz" = "eza -l"; "lz" = "eza -l";
"lza" = "eza -al"; "lza" = "eza -al";
"y" = "job spawn { wezterm --config-file ~/.config/wezterm/launcher.lua start --always-new-process --cwd (pwd) yazi }"; "y" = "job spawn { wezterm --config-file ~/.config/wezterm/launcher.lua start --always-new-process --cwd (pwd) yazi }";

View file

@ -18,7 +18,8 @@ let
;; layer mods ;; layer mods
spcnav (tap-hold $tap-timeout 300 spc (layer-while-held navigation)) spcnav (tap-hold $tap-timeout 300 spc (layer-while-held navigation))
tabnav(multi lctrl lalt) ;; for easy single key access to tab and pane navigation
tabnav (multi lctrl lalt)
;; space cadet shift ;; space cadet shift
sp-lsft (tap-hold-press $tap-timeout $hold-timeout S-9 lsft) sp-lsft (tap-hold-press $tap-timeout $hold-timeout S-9 lsft)