diff --git a/pkgs/build-support/make-darwin-bundle/write-darwin-bundle.nix b/pkgs/build-support/make-darwin-bundle/write-darwin-bundle.nix
index d21e0475e2d..fde977c3636 100644
--- a/pkgs/build-support/make-darwin-bundle/write-darwin-bundle.nix
+++ b/pkgs/build-support/make-darwin-bundle/write-darwin-bundle.nix
@@ -5,6 +5,7 @@ let
CFBundleDevelopmentRegion = "English";
CFBundleExecutable = "$name";
CFBundleIconFile = "$icon";
+ CFBundleIconFiles = [ "$icon" ];
CFBundleIdentifier = "org.nixos.$name";
CFBundleInfoDictionaryVersion = "6.0";
CFBundleName = "$name";
@@ -25,11 +26,8 @@ in writeScriptBin "write-darwin-bundle" ''
${pListText}
EOF
- if [[ $squircle != 0 && $squircle != "false" ]]; then
- sed "
- s|CFBundleIconFile|CFBundleIconFiles|;
- s|$icon|$icon|
- " -i "$plist"
+ if [[ $squircle == 0 || $squircle == "false" ]]; then
+ sed '/CFBundleIconFiles/,\||d' -i "$plist"
fi
cat > "$prefix/Applications/$name.app/Contents/MacOS/$name" <