Skip to content

About

NixOS Flake for Granola

Resources

Stars

1 star

Watchers

0 watching

Forks

 
 

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Granola on Linux

Granola only ships for macOS and Windows. It is an Electron app though, so the macOS .dmg already holds all of the app's JavaScript, which runs anywhere. It is just attached to a macOS runtime. This flake swaps in the Linux runtime and fixes what breaks, packaged as a reproducible Nix derivation. You get a real Linux app. No Wine, no VM, no emulation.

Granola running on Linux

Run it

You need Nix with flakes enabled, and x86-64 Linux.

NIXPKGS_ALLOW_UNFREE=1 nix run github:howird/granola-flake --impure

Or install it properly (nix run doesn't touch your profile or desktop files, which sign-in needs — see below):

NIXPKGS_ALLOW_UNFREE=1 nix profile install github:howird/granola-flake --impure

Sign-in

Granola's OAuth flow finishes by redirecting your browser to a granola://... URL, which the OS hands off to the app. That handoff needs the .desktop file this flake installs to actually be registered as the granola:// handler:

  • Use nix profile install (above), not nix run — a nix run invocation never touches your profile or ~/.local/share/applications, so there's nothing for the OS to hand the URL off to.
  • On NixOS, if ~/.config/mimeapps.list is a read-only symlink (managed via home-manager's xdg.mimeApps), declare the association there instead of relying on a runtime xdg-mime default:
    xdg.mimeApps.defaultApplications."x-scheme-handler/granola" = "granola.desktop";
    and add the package (inputs.granola.packages.${system}.granola) to home.packages.
  • Elsewhere, nix profile install plus a normal desktop environment's own .desktop-file scanning is usually enough on its own.

Set NIXPKGS_ALLOW_UNFREE=1 because Granola is proprietary — same reason claude-desktop-linux-flake needs it.

What works

✅ Notes, editor, sync, AI features, and search. The core app.
✅ Sign-in with Google, Microsoft, or SSO
✅ Encrypted local database that survives restarts
✅ Microphone recording
⚠️ System audio capture is limited. The macOS build uses Core Audio to hear the other side of a call. On Linux the app falls back to a browser style capture path.
❌ Apple Calendar (EventKit). Google and Microsoft calendars still work, since those run on the server.
❌ Global hotkeys
❌ Click-and-drag window dragging (the plugin providing it ships no working Linux binary; stubbed out rather than crashing the app)
❌ Auto-update. Nix handles updates instead — see CLAUDE.md for bumping the pinned version.

How it works

Granola's .dmg isn't a Linux binary, so getting it running here means:

  1. Extracting the .dmg with 7zz — its LZFSE compression needs a modern 7-Zip; p7zip can't read it.
  2. Reading the Electron version out of Electron Framework.framework/.../Info.plist, then fetching that exact Linux Electron build from electron/electron's GitHub releases.
  3. Dropping Granola's app.asar and app.asar.unpacked into that runtime's resources/, replacing Electron's own default demo app.
  4. Patching the platform string inside app.asar so it reports Windows. Granola's API returns a 500 error for platform=linux, so sign-in fails without this.
  5. Rebuilding better-sqlite3-multiple-ciphers from the C++ source inside app.asar.unpacked — Granola's fork adds an updateHook() that no public prebuild ships — targeting the Electron ABI via node-gyp.
  6. Replacing electron-click-drag-plugin's native module with a no-op stub: its bundled Linux binary segfaults on load, and Granola requires it unconditionally with no error handling, so a broken native module here otherwise takes down the whole app before a window ever opens.

All six of those steps have failure modes that don't point at the real cause. pkgs/granola.nix has the exact commands, with comments explaining each one — see CLAUDE.md for the full architecture writeup and how to bump the pinned version.

Notes

  • Nothing here gets around licensing or sign-in. You use your own account and the app talks to Granola's real servers. The only patches are a platform label their API refuses to accept, and a no-op stub for a native module that only ever shipped a broken Linux build.
  • Granola's code belongs to Granola. This flake fetches it fresh from Granola's own CDN at build time — nothing proprietary is committed to this repo.
  • ~/.config/Granola (your notes cache and login) is untouched by adding or removing the Nix package.

About

NixOS Flake for Granola

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages