Skip to content

fix(nix): build desktop package with electron#26140

Open
tommoa wants to merge 1 commit intoanomalyco:devfrom
tommoa:fix-nix-electron-desktop
Open

fix(nix): build desktop package with electron#26140
tommoa wants to merge 1 commit intoanomalyco:devfrom
tommoa:fix-nix-electron-desktop

Conversation

@tommoa
Copy link
Copy Markdown

@tommoa tommoa commented May 7, 2026

The desktop package no longer has the Tauri src-tauri tree, so the Nix desktop derivation packages the Electron app instead of using cargo-tauri. The Electron renderer and main outputs are built with the shared node_modules derivation, and the unpacked app uses Nix-provided Electron to avoid sandbox downloads.

Issue for this PR

Closes #26120

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This PR modifies the desktop flake to use the new electron build process for the desktop app. There were some things that needed to be modified to have parity with the old flake:

  • nix does not allow writable locations, so the auto-updater needed to be disabled
  • electron-builder doesn't generate a .desktop for Linux, so a .desktop is made in the flake

How did you verify your code works?

nix run .#desktop on macOS 26.4.1, which worked.

# nix run .#desktop
(node:65828) ExperimentalWarning: SQLite is an experimental feature and might change at any time
(Use `OpenCode --trace-warnings ...` to show where the warning was created)
17:31:20.631 › app starting { version: '1.14.40+03c4c47', packaged: true, onboardingTest: false }
17:31:20.806 › tauri migration: already done, skipping
17:31:20.868 › sidecar connection started { url: 'http://127.0.0.1:65516' }
17:31:20.869 › spawning sidecar { url: 'http://127.0.0.1:65516' }
[server] Loaded shell environment with -il (69 vars)
17:31:22.045 › loading task finished
17:31:22.046 › init step { step: { phase: 'done' } }
17:31:22.550 › awaiting server ready
17:31:22.551 › server ready { url: 'http://127.0.0.1:65516' }

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

The desktop package no longer has the Tauri src-tauri tree, so the Nix
desktop derivation packages the Electron app instead of using
cargo-tauri. The Electron renderer and main outputs are built with the
shared node_modules derivation, and the unpacked app uses Nix-provided
Electron to avoid sandbox downloads.

Electron auto-updates are disabled for Nix builds, the derivation
version is preserved in Electron metadata, the app runtime has ripgrep
on PATH, and the unpacked Linux app includes desktop integration.

Fixes anomalyco#26120
@tommoa tommoa requested a review from adamdotdevin as a code owner May 7, 2026 07:32
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.

nix build .#desktop fails after Electron migration

1 participant