Skip to content

feat(nix): add complete Nix build system with Tauri and OpenGL fixes #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

commandodev
Copy link

Add Nix flake with proper Tauri v2 build configuration that resolves both asset embedding and graphics driver issues on NixOS.

Key changes:

  • Add flake.nix with separate frontend and backend builds
  • Use bun2nix for frontend build with proper filtering
  • Use cargo-tauri for Rust build to embed assets correctly
  • Modify tauri.conf.json during build to skip frontend rebuild
  • Add software rendering fallback for OpenGL compatibility
  • Use wrapGAppsHook3 for proper GTK/WebKit integration
  • Add result/ to .gitignore and .envrc for direnv support

The application now builds and runs successfully on NixOS without requiring manual driver configuration or external dependencies.

I've only tested this on wayland/hyprland so far.

Add Nix flake with proper Tauri v2 build configuration that resolves
both asset embedding and graphics driver issues on NixOS.

Key changes:
- Add flake.nix with separate frontend and backend builds
- Use bun2nix for frontend build with proper filtering
- Use cargo-tauri for Rust build to embed assets correctly
- Modify tauri.conf.json during build to skip frontend rebuild
- Add software rendering fallback for OpenGL compatibility
- Use wrapGAppsHook3 for proper GTK/WebKit integration
- Add result/ to .gitignore and .envrc for direnv support

Fixes:
- Resolves "Could not connect to localhost" by properly embedding dist/
- Eliminates OpenGL driver errors with software rendering
- Follows nixpkgs patterns used by other Tauri applications

The application now builds and runs successfully on NixOS without
requiring manual driver configuration or external dependencies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant