Commit graph

16 commits

Author SHA1 Message Date
Evgeny Khudoba
a385371c32
refactor(nix): rely on cargo-tauri.hook standard phases (#1335)
Some checks failed
Main Branch Build / build (, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
Main Branch Build / build (--bundles appimage,deb,rpm, ubuntu-24.04-arm, aarch64-unknown-linux-gnu) (push) Has been cancelled
Main Branch Build / build (--bundles appimage,rpm, ubuntu-24.04, x86_64-unknown-linux-gnu) (push) Has been cancelled
Main Branch Build / build (--bundles deb, ubuntu-22.04, x86_64-unknown-linux-gnu) (push) Has been cancelled
Main Branch Build / build (--target aarch64-apple-darwin, macos-26, aarch64-apple-darwin) (push) Has been cancelled
Main Branch Build / build (--target aarch64-pc-windows-msvc, windows-11-arm, aarch64-pc-windows-msvc) (push) Has been cancelled
Main Branch Build / build (--target x86_64-apple-darwin, macos-latest, x86_64-apple-darwin) (push) Has been cancelled
nix build check / nix-build (push) Has been cancelled
Set buildAndTestSubdir + tauriBundleType so cargo-tauri.hook handles
build/install correctly, and drop the manual overrides:

- installPhase override (was needed because hook didn't know to pushd
  into src-tauri without buildAndTestSubdir; hook's install script now
  finds bundle/deb/.../data/usr/* on its own)
- preBuild with `bun run build` (hook runs beforeBuildCommand from
  tauri.conf.json itself; bun2nix.hook has node_modules ready before
  buildPhase)
- jq del(.build.beforeBuildCommand) in postPatch (no longer needed)

Net change: +3/-18. End-to-end verified on NixOS x86_64-linux:
GigaAM v3 ASR + Whisper large-v3-turbo on Vulkan both work.
2026-04-30 08:46:23 +08:00
Evgeny Khudoba
c1e11faa71
refactor(nix): replace manual bindgen env with rustPlatform.bindgenHook (#1255) 2026-04-15 19:06:59 -04:00
Yuxiang Qiu
c1697b2a95
nix: use symlinkJoin for ALSA_PLUGIN_DIR (#1226) 2026-04-05 18:15:59 +08:00
Evgeny Khudoba
892658ee89
fix(nix): remove onnxruntime overlay, use nixpkgs native package (#1149) 2026-03-31 07:39:10 +08:00
CJ Pais
a3015026a0
whisper-rs 0.16.0 and ort.rc12 (#1041)
* test build for 0.16.0

* macos 10.15?

* format

* shorter dir for build on windows?

* Update build.yml

* move

* Update build.yml

* long path support

* clang

* try

* try

* move to ort rc12

* use ms prebuilt?

* use lower version for 1.23.1

* download my prebuilt

* Update build.yml

* Update build.yml

* fix?

* fix(nix): use dynamic linking for ort-sys 2.0.0-rc.12

ort-sys rc.12 removed pkg-config support; without ORT_PREFER_DYNAMIC_LINK
it defaults to static linking against ORT_LIB_LOCATION, which fails
because nixpkgs only provides shared libraries (.so).

* fix(nix): override onnxruntime to 1.24.2 for ort-sys rc.12 compatibility

ort 2.0.0-rc.12 enables API v24 by default, but nixpkgs only ships
onnxruntime 1.23.2 (API v23), causing a runtime panic on model load.

Use Microsoft's prebuilt binaries for onnxruntime 1.24.2 via overlay,
patched with autoPatchelfHook for NixOS compatibility.

This overlay should be removed once nixpkgs merges onnxruntime ≥ 1.24:
https://github.com/NixOS/nixpkgs/pull/499389

* updated deps for whisper

* fix(nix): sync devShell with packages for ort-sys rc.12 compatibility

- Extract shared definitions (commonNativeDeps, gstPlugins, commonEnv,
  onnxruntimeOverlay) to avoid duplication between packages and devShells
- Add onnxruntime 1.24.2 overlay to devShell (was only in packages)
- Add BINDGEN_EXTRA_CLANG_ARGS to devShell so bindgen can find stdio.h
  and generate correct vulkan bindings for whisper-rs-sys
- Add ORT_LIB_LOCATION and ORT_PREFER_DYNAMIC_LINK to devShell
- Replace libappindicator with libayatana-appindicator in devShell
- Add onnxruntime and vulkan-loader to devShell LD_LIBRARY_PATH

* fix missing lib in the handy blob dl

* scope lib verification

* dont run bun2nix on windows

---------

Co-authored-by: Evgeny <evgeny.khudoba@yandex.ru>
2026-03-19 15:00:51 +08:00
COGnITO (mode: carbon)
cf284b1700
feat(nix): NixOS integration — ALSA_PLUGIN_DIR, nixosModule, home-manager module (#1025)
- Set ALSA_PLUGIN_DIR to PipeWire's alsa-lib path in package wrapper
  (NixOS store paths aren't in ALSA's default plugin search)
- Add nixosModules.default: udev rule for /dev/uinput, systemPackages
- Add homeManagerModules.default: systemd user service for autostart

Co-authored-by: zitongcharliedeng <zitongcharliedeng@users.noreply.github.com>
2026-03-16 20:47:32 +08:00
Evgeny Khudoba
7056edce28
fix(nix): replace manual hash management with bun2nix (#1021)
* fix(nix): replace manual hash management with bun2nix

Eliminate the recurring problem of Nix build hashes breaking whenever
bun dependencies change or the bun version in nixpkgs updates.

Changes:
- Add bun2nix flake input (pinned to v2.0.1) for per-package fetchurl
  expressions from bun.lock, replacing the single FOD hash approach
- Use allowBuiltinFetchGit for cargo git dependencies, removing manual
  outputHashes that required updates on every git dep change
- Add scripts/check-nix-deps.ts (cross-platform, runs via bun) that
  auto-regenerates .nix/bun.nix when bun.lock changes, triggered by
  the postinstall hook in package.json
- Update CI workflow to verify bun.nix is in sync and evaluate flake
- Remove scripts/update-nix-hashes.sh (no longer needed)

* style: format check-nix-deps.ts with prettier

* ci(nix): make nix-check job a required check

* fix(nix): address review feedback

- Fix bun2nix input pinning: use path syntax (github:owner/repo/tag)
  instead of ?tag= query parameter so flake.lock records the ref
  and `nix flake update` respects the pin
- Make check-nix-deps.ts exit with 0 on bun2nix failure so that
  `bun install` is not blocked for non-Nix developers (CI validates
  bun.nix independently)
- Fix stale reference to check-nix-deps.sh in flake.nix comment

* ci(nix): add full nix build step to CI workflow

Add `nix build .#handy -L --show-trace` after flake evaluation to
catch runtime build errors (broken dependencies, sandbox issues,
compilation failures) that flake eval alone cannot detect.

* fix(nix): update bun2nix pin from 2.0.1 to 2.0.8

bun2nix 2.0.1 has a bug in cache-entry-creator that causes
"ln: failed to create symbolic link '/p': Permission denied"
during the build. Version 2.0.8 fixes this.
2026-03-13 18:45:46 +08:00
Evgeny Khudoba
5dbe99bf00
fix(nix): Fixed nix hash for dependencies, added CI job and script for updating dependencies versions (#948) 2026-03-12 18:39:39 +08:00
Phuoc Thinh Vu
15fbc47f5a
fix(nix): update bunDeps outputHash (#853) 2026-02-19 04:03:44 -08:00
MaximilianGaedig
cbc80802cb
fix: update nix hash for dependencies (#842) 2026-02-17 22:13:10 +08:00
Sami Ansari
3b88717091
fix(nix): address PR #778 review comments (#800)
- Replace patchShebangs with targeted substituteInPlace for tsc/vite
  shebangs, pointing them to bun instead of node
- Use `bun run build` instead of `${pkgs.bun}/bin/bun run build`
  since bun is already in nativeBuildInputs
- Remove nodejs from nativeBuildInputs (no longer needed)
- Add comment explaining why doCheck is disabled
2026-02-13 08:41:25 +08:00
Phuoc Thinh Vu
336ccffcc7
fix(nix): fix ALSA mismatch, add GStreamer plugins, and repair UI environment (#787)
- Update `flake.lock` to synchronize `alsa-lib` and `glibc` versions, resolving a runtime `dlopen` crash when loading the PipeWire plugin.
  - Add `gstreamer`, `gst-plugins-base`, `good`, `bad`, and `ugly` to both `buildInputs` (package) and `devShell` to support WebKitGTK audio/video playback (resolving missing `appsink`/`autoaudiosink`).
  - Set `GST_PLUGIN_SYSTEM_PATH_1_0` in both environments so GStreamer can locate the plugins at runtime.
  - Manually set `XDG_DATA_DIRS` in `devShell` to include `gsettings-desktop-schemas` and `gtk3` schemas, fixing UI scaling, theming, and missing asset issues during development.

Co-authored-by: Thinh Vu <phuocthinhvu@gmail.com>
2026-02-11 21:34:03 +08:00
Sami Ansari
c34e7d584b
fix(nix): build from source instead of wrapping AppImage (#778)
* fix(nix): build from source instead of wrapping AppImage (#701)

Replace the AppImage-based Nix package with a native from-source build
using cargo-tauri.hook + rustPlatform.buildRustPackage. This eliminates
the recurring hash mismatch failures when releases update the binary.

- Build frontend (bun) and backend (cargo tauri) from source
- Vendor JS deps as a fixed-output derivation
- Patch libappindicator-sys for Nix store path
- Patch ferrous-opencc to skip cbindgen (upstream removed in v0.3.1+)
- Wrap binary with WEBKIT_DISABLE_DMABUF_RENDERER and LD_LIBRARY_PATH
- Delete update-flake-hash.yml workflow (no longer needed)
- devShell unchanged

* add support for arm64

---------

Co-authored-by: CJ Pais <cj@cjpais.com>
2026-02-11 08:47:39 +08:00
Phuoc Thinh Vu
14db1791d5
fix: missing dependency for flake.nix (#751)
* fix: missing dependency for flake.nix

* fix formatting

* remove bindings.ts changes

---------

Co-authored-by: Thinh Vu <phuocthinhvu@gmail.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
2026-02-10 09:34:33 +08:00
kohane27
f7f41eb357
fix(nix): add missing dependencies (#708) 2026-02-05 07:03:00 +07:00
Sami Ansari
6827fb51d4
Add Nix flake for NixOS support (#561)
* Add Nix flake for NixOS support

Provides:
- handy-appimage: AppImage-based package (default)
- devShell: Development environment for building from source

* fix(nix): address PR feedback for flake.nix

- Remove aarch64-linux from supportedSystems (ARM64 builds not produced)
- Read version dynamically from Cargo.toml instead of hardcoding
  This enables automated updates during GitHub releases

* chore(nix): add GitHub Actions workflow to auto-update AppImage hash

Adds a separate workflow triggered on release publication that:
- Fetches the released AppImage
- Computes the SRI hash using nix-prefetch-url
- Updates flake.nix with the new hash
- Commits and pushes changes directly

Includes retry logic for timing issues and defensive checks to verify
the hash was actually updated and skip commits if unchanged.

* Update flake.nix hash to resolve mismatch

Co-authored-by: pinage404 <pinage404@gmail.com>

* Update flake.nix to install dependencies automatically

Co-authored-by: pinage404 <pinage404@gmail.com>

* fix: update AppImage hash for v0.7.0

* modified description

---------

Co-authored-by: pinage404 <pinage404@gmail.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
2026-02-01 10:32:49 +08:00