CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
101 lines
2.2 KiB
Nix
101 lines
2.2 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
rustPlatform,
|
|
pkg-config,
|
|
cargo-tauri,
|
|
bun,
|
|
nodejs,
|
|
cargo,
|
|
rustc,
|
|
jq,
|
|
wrapGAppsHook4,
|
|
makeWrapper,
|
|
dbus,
|
|
glib,
|
|
gtk4,
|
|
libsoup_3,
|
|
librsvg,
|
|
libappindicator,
|
|
glib-networking,
|
|
openssl,
|
|
webkitgtk_4_1,
|
|
gst_all_1,
|
|
opencode,
|
|
}:
|
|
rustPlatform.buildRustPackage (finalAttrs: {
|
|
pname = "opencode-desktop";
|
|
inherit (opencode)
|
|
version
|
|
src
|
|
node_modules
|
|
patches
|
|
;
|
|
|
|
cargoRoot = "packages/desktop/src-tauri";
|
|
cargoLock.lockFile = ../packages/desktop/src-tauri/Cargo.lock;
|
|
buildAndTestSubdir = finalAttrs.cargoRoot;
|
|
|
|
nativeBuildInputs = [
|
|
pkg-config
|
|
cargo-tauri.hook
|
|
bun
|
|
nodejs # for patchShebangs node_modules
|
|
cargo
|
|
rustc
|
|
jq
|
|
makeWrapper
|
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook4 ];
|
|
|
|
buildInputs = lib.optionals stdenv.isLinux [
|
|
dbus
|
|
glib
|
|
gtk4
|
|
libsoup_3
|
|
librsvg
|
|
libappindicator
|
|
glib-networking
|
|
openssl
|
|
webkitgtk_4_1
|
|
gst_all_1.gstreamer
|
|
gst_all_1.gst-plugins-base
|
|
gst_all_1.gst-plugins-good
|
|
gst_all_1.gst-plugins-bad
|
|
];
|
|
|
|
strictDeps = true;
|
|
|
|
preBuild = ''
|
|
cp -a ${finalAttrs.node_modules}/{node_modules,packages} .
|
|
chmod -R u+w node_modules packages
|
|
patchShebangs node_modules
|
|
patchShebangs packages/desktop/node_modules
|
|
|
|
mkdir -p packages/desktop/src-tauri/sidecars
|
|
cp ${opencode}/bin/opencode packages/desktop/src-tauri/sidecars/opencode-cli-${stdenv.hostPlatform.rust.rustcTarget}
|
|
'';
|
|
|
|
# see publish-tauri job in .github/workflows/publish.yml
|
|
tauriBuildFlags = [
|
|
"--config"
|
|
"tauri.prod.conf.json"
|
|
"--no-sign" # no code signing or auto updates
|
|
];
|
|
|
|
# FIXME: workaround for concerns about case insensitive filesystems
|
|
# should be removed once binary is renamed or decided otherwise
|
|
# darwin output is a .app bundle so no conflict
|
|
postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
|
|
mv $out/bin/OpenCode $out/bin/opencode-desktop
|
|
sed -i 's|^Exec=OpenCode$|Exec=opencode-desktop|' $out/share/applications/OpenCode.desktop
|
|
'';
|
|
|
|
meta = {
|
|
description = "OpenCode Desktop App";
|
|
homepage = "https://opencode.ai";
|
|
license = lib.licenses.mit;
|
|
mainProgram = "opencode-desktop";
|
|
inherit (opencode.meta) platforms;
|
|
};
|
|
})
|