12 lines
234 B
Nix
12 lines
234 B
Nix
with import <nixpkgs> {};
|
|
|
|
pkgs.writeShellScriptBin "nix-cmd" ''
|
|
#!/bin/sh
|
|
pkg="''${@:1:1}"
|
|
rest="''${@:2}"
|
|
if [ "$rest" = "" ] ; then
|
|
rest="$pkg"
|
|
fi
|
|
exec nix-shell -p $pkg --run "$(echo "$rest" | sed -E "s/^_ /$pkg /")"
|
|
''
|
|
|