fish: augment run and shell with -u params (unstable)

This commit is contained in:
2026-10-30 07:40:41 +01:00
parent d649aed4d6
commit a49524da88
+19 -5
View File
@@ -67,14 +67,28 @@ with lib; {
cd $argv cd $argv
''; '';
run = '' 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 = '' shell = ''
set args set -l channel nixpkgs
for arg in $argv
set args $args nixpkgs#$arg if test "$argv[1]" = -u -o "$argv[1]" = --unstable
set channel github:NixOS/nixpkgs/nixpkgs-unstable
set -e argv[1]
end 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 = '' fish_user_key_bindings = ''
bind ctrl-space 'zi; commandline -f repaint' bind ctrl-space 'zi; commandline -f repaint'