fish: augment run and shell with -u params (unstable)
This commit is contained in:
@@ -67,14 +67,28 @@ with lib; {
|
||||
cd $argv
|
||||
'';
|
||||
run = ''
|
||||
nix run --impure nixpkgs#"$argv[1]" -- $argv[2..-1]
|
||||
set -l channel nixpkgs
|
||||
|
||||
if test "$argv[1]" = -u -o "$argv[1]" = --unstable
|
||||
set channel github:NixOS/nixpkgs/nixpkgs-unstable
|
||||
set -e argv[1]
|
||||
end
|
||||
nix run --impure $channel#"$argv[1]" -- $argv[2..-1]
|
||||
'';
|
||||
shell = ''
|
||||
set args
|
||||
for arg in $argv
|
||||
set args $args nixpkgs#$arg
|
||||
set -l channel nixpkgs
|
||||
|
||||
if test "$argv[1]" = -u -o "$argv[1]" = --unstable
|
||||
set channel github:NixOS/nixpkgs/nixpkgs-unstable
|
||||
set -e argv[1]
|
||||
end
|
||||
nix shell --impure $args
|
||||
|
||||
set -l packages
|
||||
for arg in $argv
|
||||
set -a packages $channel#$arg
|
||||
end
|
||||
|
||||
nix shell --impure $packages
|
||||
'';
|
||||
fish_user_key_bindings = ''
|
||||
bind ctrl-space 'zi; commandline -f repaint'
|
||||
|
||||
Reference in New Issue
Block a user