Skip to content

Commit 6ee41d9

Browse files
committed
fix: only create trampolines for symlink dirs
See nix-darwin/nix-darwin#1396
1 parent b703ee0 commit 6ee41d9

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

main.lisp

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,12 @@ Also resolves symlinks, if relevant.
258258

259259
;;; sync-trampolines
260260

261+
(defun symlinked-dir-p (d)
262+
(let ((resolved (uiop:directory-exists-p d)))
263+
(and resolved
264+
(not (equal (uiop:ensure-directory-pathname d)
265+
resolved)))))
266+
261267
(defun to-abs-dir (d)
262268
"Transform d into an absolute directory pathname."
263269
(uiop:ensure-pathname d
@@ -283,11 +289,15 @@ Also resolves symlinks, if relevant.
283289
(defun sync-trampolines (&rest args)
284290
(destructuring-bind (from to) (mapcar #'to-abs-dir args)
285291
(rm-rf to)
286-
(ensure-directories-exist to)
287-
(let ((apps (gather-apps from)))
288-
(dolist (app apps)
289-
(mktrampoline app (merge-pathnames (directory-name app) to)))
290-
(sync-dock apps))))
292+
;; Since 25.11 nix-darwin copies .app folders directly to /Applications. In
293+
;; that scenario, trampolines only get in the way.
294+
;; https://github.com/nix-darwin/nix-darwin/pull/1396
295+
(when (symlinked-dir-p from)
296+
(ensure-directories-exist to)
297+
(let ((apps (gather-apps from)))
298+
(dolist (app apps)
299+
(mktrampoline app (merge-pathnames (directory-name app) to)))
300+
(sync-dock apps)))))
291301

292302

293303
;;; CLI

0 commit comments

Comments
 (0)