comma.nu
Sin formato
# Run a command if known, otherwise run it with nix
def , [cmd: string, ...args: string] {
if (not (which $cmd | is-empty)) {
^$cmd ...$args
return
}
^nix run $"nixpkgs#($cmd)" -- ...$args
}
1 | # Run a command if known, otherwise run it with nix |
2 | def , [cmd: string, ...args: string] { |
3 | if (not (which $cmd | is-empty)) { |
4 | ^$cmd ...$args |
5 | return |
6 | } |
7 | ^nix run $"nixpkgs#($cmd)" -- ...$args |
8 | } |
9 |