Change nix to flake parts#3305
Closed
disassembler wants to merge 30 commits intoinput-output-hk:developfrom
Closed
Change nix to flake parts#3305disassembler wants to merge 30 commits intoinput-output-hk:developfrom
disassembler wants to merge 30 commits intoinput-output-hk:developfrom
Conversation
- Add nixpkgsJs input pinned to nixpkgs-22.11-darwin - Use pkgsJs for electron and native module builds to avoid glibc version mismatch - Apply glibc-electron-loader.patch to pkgsJs.glibc for electron LD_PLEASE_INTERPRET support - Update node_modules and daedalusJs derivations to use pkgsJs.stdenv - Improve source filtering to exclude .direnv, .agent, node_modules, etc. This fixes the 'GLIBC_2.38 not found' error when running daedalus-preview by ensuring native Node.js modules are built with the same glibc version as the bundled electron.
Mithril provides snapshots in in-memory format, not LMDB. The conversion step was incorrectly converting them TO LMDB format, which was unnecessary and causing issues. Skip the _convertSnapshot step entirely to use the snapshots as-is.
- Add .envrc for automatic nix flake shell activation - Ignore .direnv directory and nix build results - Ignore .agent/settings.local.json for per-user agent settings
Fixes GLIBC_2.39 mismatch errors on non-NixOS systems when running yarn dev. The native node modules (usb_bindings.node, HID.node, detection.node) are now built and patched against libraries from nixpkgs-22.11 (glibc 2.35) to match the electron bundle. Changes: - devshells.nix: Use pkgsJs for libusb1, systemd, and compiler runtime - x86_64-windows.nix: Use pkgsJs.libusb1 for consistency 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Allow selecting devShell cluster via environment variable: export DAEDALUS_CLUSTER=preprod # or mainnet, preview, selfnode direnv reload Defaults to preprod if not set.
- Add --disable-setuid-sandbox and --no-sandbox flags to match production - Disable React Refresh plugin which has Electron compatibility issues - Disable React Refresh transform in SWC config These changes fix runtime errors in the development environment.
- Add bin/ directories with hard links to installers for all platforms
- Set meta.mainProgram to enable nix run .#installer-{cluster}
- Replace deprecated runCommandNoCC with runCommand
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
The apple_sdk_11_0 was removed in nixpkgs-25.11. Use nixpkgs-22.11 (pkgsJs) for Darwin frameworks to maintain compatibility. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
41f77a7 to
7557301
Compare
GHC 8.10.7 (ghc8107) was removed in nixpkgs-25.11, so the Windows installer build needs to use pkgsJs (nixpkgs-22.11) where it still exists.
3685316 to
6c31b99
Compare
…uilds Use pkgsJs (nixpkgs-22.11) instead of pkgs (nixpkgs-25.11) for: - Darwin: darwin.cctools, xcbuild, python3 to avoid clang compatibility issues with node-addon-api (enum value -1 error) - Windows: haskell.lib.justStaticExecutables to avoid disallowGhcReference argument incompatibility in Haskell generic-builder These components require the older toolchain from nixpkgs-22.11 to build successfully after the nixpkgs-25.11 upgrade.
Use pkgsJs.stdenv.mkDerivation instead of pkgs.stdenv.mkDerivation for the node_modules derivation on Darwin. This ensures the entire build environment (compiler, linker, and build tools) comes from nixpkgs-22.11, avoiding both clang enum compatibility issues and linker errors with native node modules. Also consolidate darwin.cctools, xcbuild, and python3 to use pkgsJs for consistency.
Add -Wno-enum-constexpr-conversion flag to allow blake-hash and other native modules to compile when cross-compiling x86_64-darwin on Apple Silicon builders. The node-addon-api uses -1 as a sentinel enum value which newer clang versions reject as invalid. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
39300d6 to
d1e2f7f
Compare
Previously, npm_config_cxxflags was only set as a derivation attribute but not explicitly exported in the buildPhase script. This caused electron-rebuild on native aarch64-darwin builds to not pick up the -Wno-enum-constexpr-conversion flag, resulting in blake-hash compilation errors. The export now ensures both x86_64-darwin cross-compilation and native aarch64-darwin builds properly pass the flag to node-gyp/electron-rebuild.
18e287e to
ae38a71
Compare
Add explicit export of npm_config_cxxflags before electron-rebuild calls to ensure the -Wno-enum-constexpr-conversion flag is passed to node-gyp. This fixes blake-hash compilation errors on aarch64-darwin with newer clang that rejects enum constexpr conversions.
789b0e1 to
006d010
Compare
Changes: - Updated node_modules derivation to use -Wno-error instead of -Wno-enum-constexpr-conversion for npm_config_cxxflags - Updated daedalus derivation to match - Updated rebuild-native-modules.sh script to export the flag with multiple variations for compatibility The -Wno-enum-constexpr-conversion flag is not supported by older clang versions in nixpkgs-22.11 (used for aarch64-darwin native builds). Using -Wno-error makes all warnings non-fatal and works across all clang versions, fixing blake-hash compilation errors. This fix applies to: - x86_64-darwin (cross-compiled on aarch64) - aarch64-darwin (native builds) Fixes the enum constexpr conversion error in node-addon-api header that occurs when compiling native Node.js modules with newer clang that enforces stricter enum type checking.
006d010 to
aebacac
Compare
Native module compilation during electron-rebuild fails because newer clang enforces strict enum checking. Environment variables don't propagate through the electron-rebuild -> node-gyp -> make -> clang++ chain. Solution: Create a clang++ wrapper that automatically adds -Wno-error to all compiler invocations. This intercepts the compiler calls from make during native module builds. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…mpilation Switch from pkgs.stdenv (nixpkgs-25.11) to pkgsJs.stdenv (nixpkgs-22.11) for Darwin daedalus derivation to fix native module compilation issues. Root cause: - Darwin native modules (bigint-buffer, blake-hash, etc.) fail to compile with the newer clang 21.1.7 from nixpkgs-25.11 - These modules were built/tested with the older toolchain from nixpkgs-22.11-darwin - Using mismatched stdenv and darwin frameworks causes compilation errors Solution: - Use pkgsJs.stdenv.mkDerivation for the main daedalus package - This provides the older, stable Darwin toolchain that native modules expect - Aligns with existing use of pkgsJs.darwin frameworks and pkgsJs.python3 - Removes the clang++ wrapper that was causing 'Argument list too long' errors The wrapper approach is no longer needed because: - CXXFLAGS=-Wno-error is set via environment variables in patchElectronRebuild - Using the correct stdenv avoids the enum-constexpr issues entirely
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is based on the mithril branch and cleans up the nix flake significantly by switching to flake-parts.
It also introduces a default formatter.
Todos
Screenshots
Testing Checklist
Review Checklist
Basics
input-output-hk/daedalus-devandinput-output-hk/daedalus-qaassigned as PR reviewersrelease-vNext,feature/bug/chore,WIP)yarn manage:translationsproduces no changes)yarn storybook)yarn.lockfile is updatedCode Quality
Testing
After Review