diff options
| author | Caleb Norton <[email protected]> | 2026-01-16 16:59:07 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-16 16:59:07 -0600 |
| commit | aca1eb6b5b1f74396a9856fa2c413a79a55ca69f (patch) | |
| tree | b03c9dbefaf93a9703a528b78e3a74fffecb93a3 | |
| parent | 3d095e7fe7087057467d29e78a579ff02d28da14 (diff) | |
| download | opencode-aca1eb6b5b1f74396a9856fa2c413a79a55ca69f.tar.gz opencode-aca1eb6b5b1f74396a9856fa2c413a79a55ca69f.zip | |
fix(nix): add desktop application entry (#8972)
| -rw-r--r-- | nix/desktop.nix | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/nix/desktop.nix b/nix/desktop.nix index 4b659413a..9fb73b563 100644 --- a/nix/desktop.nix +++ b/nix/desktop.nix @@ -15,6 +15,8 @@ cargo, rustc, makeBinaryWrapper, + copyDesktopItems, + makeDesktopItem, nodejs, jq, }: @@ -57,12 +59,28 @@ rustPlatform.buildRustPackage rec { pkg-config bun makeBinaryWrapper + copyDesktopItems cargo rustc nodejs jq ]; + # based on packages/desktop/src-tauri/release/appstream.metainfo.xml + desktopItems = lib.optionals stdenv.isLinux [ + (makeDesktopItem { + name = "ai.opencode.opencode"; + desktopName = "OpenCode"; + comment = "Open source AI coding agent"; + exec = "opencode-desktop"; + icon = "opencode"; + terminal = false; + type = "Application"; + categories = [ "Development" "IDE" ]; + startupWMClass = "opencode"; + }) + ]; + buildInputs = [ openssl ] @@ -121,6 +139,10 @@ rustPlatform.buildRustPackage rec { # It looks for them in the location specified in tauri.conf.json. postInstall = lib.optionalString stdenv.isLinux '' + # Install icon + mkdir -p $out/share/icons/hicolor/128x128/apps + cp ../../../packages/desktop/src-tauri/icons/prod/128x128.png $out/share/icons/hicolor/128x128/apps/opencode.png + # Wrap the binary to ensure it finds the libraries wrapProgram $out/bin/opencode-desktop \ --prefix LD_LIBRARY_PATH : ${ |
