# Run a command if known, otherwise run it with nix
export def main [
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
}