diff --git a/pkgs/by-name/mo/mouser/package.nix b/pkgs/by-name/mo/mouser/package.nix index 8c32ba61577e..fd74ae98cb08 100644 --- a/pkgs/by-name/mo/mouser/package.nix +++ b/pkgs/by-name/mo/mouser/package.nix @@ -39,6 +39,14 @@ python3Packages.buildPythonApplication (finalAttrs: { [ evdev ] + ) + ++ lib.optionals stdenv.hostPlatform.isDarwin ( + with python3Packages; + [ + pyobjc-core + pyobjc-framework-Cocoa + pyobjc-framework-Quartz + ] ); installPhase = '' @@ -52,6 +60,31 @@ python3Packages.buildPythonApplication (finalAttrs: { install -Dm444 packaging/linux/69-mouser-logitech.rules \ -t $out/lib/udev/rules.d '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + appBundle="$out/Applications/Mouser.app" + mkdir -p "$appBundle/Contents/MacOS" "$appBundle/Contents/Resources" + install -Dm644 images/AppIcon.icns "$appBundle/Contents/Resources/AppIcon.icns" + + cat > "$appBundle/Contents/Info.plist" <<'EOF' + + + + + CFBundleNameMouser + CFBundleDisplayNameMouser + CFBundleExecutableMouser + CFBundleIdentifierio.github.tombadash.mouser + CFBundleIconFileAppIcon + CFBundleShortVersionString${finalAttrs.version} + CFBundleVersion${finalAttrs.version} + CFBundlePackageTypeAPPL + NSHighResolutionCapable + LSUIElement + LSMinimumSystemVersion12.0 + + + EOF + '' + '' runHook postInstall ''; @@ -70,6 +103,9 @@ python3Packages.buildPythonApplication (finalAttrs: { '' + '' --add-flags "$out/share/mouser/main_qml.py" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + makeWrapper $out/bin/mouser $out/Applications/Mouser.app/Contents/MacOS/Mouser ''; desktopItems = lib.optionals stdenv.hostPlatform.isLinux [