diff --git a/env/rust.scm b/env/rust.scm index b6325d7..73dd134 100644 --- a/env/rust.scm +++ b/env/rust.scm @@ -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)