rust: Use mounted directory when present
This commit is contained in:
parent
0be12f9a87
commit
1fdebc187c
1 changed files with 7 additions and 2 deletions
9
env/rust.scm
vendored
9
env/rust.scm
vendored
|
@ -171,11 +171,16 @@ function."
|
|||
(throw 'file-doesnt-exist))))))))
|
||||
|
||||
(let* ((target (string-append (@@ (env) %env-directory) "/" target-name))
|
||||
(mnt (mount-environment env #:tag tag #:target target))
|
||||
;; TODO should actually detect if overlay is mounted not that the
|
||||
;; directory exists.
|
||||
(mnt (if (file-exists? target)
|
||||
target
|
||||
(overlay-mount-merged
|
||||
(mount-environment env #:tag tag #:target target))))
|
||||
(mappings (append (map (remap #f) expose)
|
||||
(map (remap #t) share))))
|
||||
(exec-in-rustup-environment '("./.cargo/bin/rust-analyzer")
|
||||
#:home (overlay-mount-merged mnt)
|
||||
#:home mnt
|
||||
#:mappings mappings)
|
||||
(sync)
|
||||
(system* "umount" target)
|
||||
|
|
Loading…
Reference in a new issue