nix-shell.elv 468 B

123456789101112131415161718192021222324252627
  1. use path
  2. edit:add-var nix~ {|@a|
  3. var is-shell = (and ^
  4. (> (count $a) 0) ^
  5. (eq $a[0] "develop") ^
  6. (not (has-value $a "--command" )))
  7. if $is-shell {
  8. set a = $a[1..]
  9. e:nix develop $@a --command elvish
  10. } else {
  11. e:nix $@a
  12. }
  13. }
  14. edit:add-var nix-shell~ {|@a|
  15. var is-shell = (not (or ^
  16. (has-value $a "--command") ^
  17. (has-value $a "--run")))
  18. if $is-shell {
  19. e:nix-shell $@a --command elvish
  20. } else {
  21. e:nix-shell $@a
  22. }
  23. }