about summary refs log tree commit diff
path: root/pkgs/applications/terminal-emulators
diff options
context:
space:
mode:
authorNicolas Mattia <nicolas@nmattia.com>2024-05-14 13:38:16 +0200
committerNicolas Mattia <nicolas@nmattia.com>2024-05-14 15:31:41 +0200
commit0d540c419c4480c760cdd74d17b9c933fcbf1ddd (patch)
treec286bdcc4a9afb9c7c526950f08641ee28b81dfa /pkgs/applications/terminal-emulators
parenta71aec5f3ae3d6c13d51d45952365e8721e8af4d (diff)
kitty: wrap correct executable on macOS
This fixes the kitty wrapProgram step to wrap the
actual `kitty` executable, which on macOS is inside the App bundle. On
macOS, `$out/bin/kitty` is just a symlink, and wrapping this symlink
(instead of the executable in the App bundle) means that the wrapper is
not used when starting the application itself (and the wrapper is only
used when the `bin/kitty` executable is used, e.g. from terminal).
Diffstat (limited to 'pkgs/applications/terminal-emulators')
-rw-r--r--pkgs/applications/terminal-emulators/kitty/default.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkgs/applications/terminal-emulators/kitty/default.nix b/pkgs/applications/terminal-emulators/kitty/default.nix
index 675e47e5f57ac..5e31ac572cab3 100644
--- a/pkgs/applications/terminal-emulators/kitty/default.nix
+++ b/pkgs/applications/terminal-emulators/kitty/default.nix
@@ -210,7 +210,10 @@ buildPythonApplication rec {
     cp -r linux-package/{bin,share,lib} "$out"
     cp linux-package/bin/kitten "$kitten/bin/kitten"
     ''}
-    wrapProgram "$out/bin/kitty" --prefix PATH : "$out/bin:${lib.makeBinPath [ imagemagick ncurses.dev ]}"
+
+    # dereference the `kitty` symlink to make sure the actual executable
+    # is wrapped on macOS as well (and not just the symlink)
+    wrapProgram $(realpath "$out/bin/kitty") --prefix PATH : "$out/bin:${lib.makeBinPath [ imagemagick ncurses.dev ]}"
 
     installShellCompletion --cmd kitty \
       --bash <("$out/bin/kitty" +complete setup bash) \