| 12345678910111213141516171819202122232425262728293031323334 |
- use path
- # nix-shell overwrites TMPDIR so set it back to the original value
- if (and (has-env ORIG_TMPDIR) (has-env IN_NIX_SHELL)) {
- set-env TMPDIR $E:ORIG_TMPDIR
- } elif (has-env TMPDIR) {
- set-env ORIG_TMPDIR $E:TMPDIR
- }
- edit:add-var nix~ {|@a|
- var is-shell = (and ^
- (> (count $a) 0) ^
- (eq $a[0] "develop") ^
- (not (has-value $a "--command" )))
- if $is-shell {
- set a = $a[1..]
- e:nix develop $@a --command elvish
- } else {
- e:nix $@a
- }
- }
- edit:add-var nix-shell~ {|@a|
- var is-shell = (not (or ^
- (has-value $a "--command") ^
- (has-value $a "--run")))
- if $is-shell {
- e:nix-shell $@a --command elvish
- } else {
- e:nix-shell $@a
- }
- }
|