Home

dotnix @9403dfa83eed5bc5ef648097dd2da3eef5208b25 - refs - log -
-
https://git.jolheiser.com/dotnix.git
My nix dotfiles
dotnix / home / nogui / nushell / autoload / comma.nu
- raw -
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
module comma {
  # Run a command if known, otherwise run it with nix
  export 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
  }
}
use comma *