diff --git a/apps/nogui/nushell/jolheiser.nu b/apps/nogui/nushell/jolheiser.nu index d7eb6fa..c6a7d3d 100644 --- a/apps/nogui/nushell/jolheiser.nu +++ b/apps/nogui/nushell/jolheiser.nu @@ -69,6 +69,18 @@ def gomodsri [] { echo 'nixpkgs.lib.fileContents ./go.mod.sri' } +# Run a command if known, otherwise run it with nix +def , [ + cmd: string # The command to run + ...args: string # Command arguments; all flags MUST be quoted + ] { + if (not (which $cmd | is-empty)) { + ^$cmd ...$args + return + } + ^nix run $"nixpkgs#($cmd)" -- ...$args +} + ## Other ## $env.EDITOR = hx $env.config = ($env.config | upsert "shell_integration" ("WEZTERM_PANE" not-in $env and "SSH_CLIENT" not-in $env))