diff options
author | Karel Kočí <cynerd@email.cz> | 2024-03-13 11:01:01 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2024-03-13 11:01:01 +0100 |
commit | 4456b47318a9014b8fa2eeec34edb165cb4ca811 (patch) | |
tree | ce65d7d89a881eb58fc5adb89a98d9988af7b987 | |
parent | 2a1d4e420236988ea5e0a794bc6c602ee617d6f1 (diff) | |
download | shellrc-4456b47318a9014b8fa2eeec34edb165cb4ca811.tar.gz shellrc-4456b47318a9014b8fa2eeec34edb165cb4ca811.tar.bz2 shellrc-4456b47318a9014b8fa2eeec34edb165cb4ca811.zip |
Change nrun from alias to function
-rw-r--r-- | shellrc.d/alias | 4 | ||||
-rw-r--r-- | shellrc.d/dev | 11 |
2 files changed, 11 insertions, 4 deletions
diff --git a/shellrc.d/alias b/shellrc.d/alias index 5e412a3..c84c83a 100644 --- a/shellrc.d/alias +++ b/shellrc.d/alias @@ -33,7 +33,3 @@ fi if command -v sdcv 2>/dev/null >&2; then alias sdcv='sdcv -c' fi - -if command -v nix 2>/dev/null >&2; then - alias nrun='nix run .' -fi diff --git a/shellrc.d/dev b/shellrc.d/dev index e66369c..04ce496 100644 --- a/shellrc.d/dev +++ b/shellrc.d/dev @@ -70,3 +70,14 @@ glv() { nvim_config() ( cd ~/.config/nvim && nvim init.vim ) + +if command -v nix 2>/dev/null >&2; then + nrun() { + nix run . -- "$@" + } + nrun_() { + local package="$1" + shift + nix run ".#$package" -- "$@" + } +fi |