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))))))))
|
(throw 'file-doesnt-exist))))))))
|
||||||
|
|
||||||
(let* ((target (string-append (@@ (env) %env-directory) "/" target-name))
|
(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)
|
(mappings (append (map (remap #f) expose)
|
||||||
(map (remap #t) share))))
|
(map (remap #t) share))))
|
||||||
(exec-in-rustup-environment '("./.cargo/bin/rust-analyzer")
|
(exec-in-rustup-environment '("./.cargo/bin/rust-analyzer")
|
||||||
#:home (overlay-mount-merged mnt)
|
#:home mnt
|
||||||
#:mappings mappings)
|
#:mappings mappings)
|
||||||
(sync)
|
(sync)
|
||||||
(system* "umount" target)
|
(system* "umount" target)
|
||||||
|
|
Loading…
Reference in a new issue