Fix nix flake build with current rust and openssl#1185
Conversation
There was a problem hiding this comment.
Code Review: Pull Request Changes
Summary
This PR updates dependency locks (flake.lock) and modifies the Nix package builder configuration.
Issues Found
1. Potential Security/Integrity Risk (flake.lock)
- Problem: The
lastModifiedtimestamps fornixpkgsandrust-overlayhave been set to future dates (e.g., 1784120854 corresponds to year 2026+). This is suspicious and could indicate:- Manual manipulation of lock file timestamps
- Potential supply chain attack if hashes don't match actual revisions
- Recommendation: Verify these timestamps match the actual commit dates. Use
nix flake updateto regenerate properly rather than manual editing.
2. Missing lib Parameter (packages.nix)
- Problem: The
libparameter was removed from the function arguments butlib.optionalStringwas used in the removedpostFixupsection. While this specific usage is gone, otherlibfunctions might be needed later. - Recommendation: Keep
libin the parameter list if any standard library functions are used elsewhere in the function.
3. Removed RPATH Handling (packages.nix)
- Problem: The
postFixupsection that setpatchelf --set-rpathfor non-Darwin systems was removed. This could cause runtime linking issues on Linux if the binary depends on libraries not in standard paths. - Recommendation:
- If
opensslis now the only dependency, verify it's properly linked via pkg-config - Consider keeping the RPATH fixup for other potential runtime dependencies
- If
4. strictDeps = true Addition (packages.nix)
- Problem: Setting
strictDeps = truewithout ensuring all build dependencies are properly declared can cause build failures. This is a significant behavioral change. - Recommendation: Test thoroughly with this flag enabled. Ensure all necessary dependencies are in
nativeBuildInputsorbuildInputs.
5. Missing stdenv Dependency (packages.nix)
- Problem:
stdenvwas removed from parameters butstdenv.hostPlatform.isDarwinwas used in the removed code. If any otherstdenvreferences exist elsewhere, this will cause errors. - Recommendation: Verify no other
stdenvusage remains in the function.
Recommendations
-
Regenerate flake.lock properly:
nix flake update nixpkgs rust-overlay
-
Keep
libparameter for future compatibility:{ lib, rustPlatform, pkg-config, openssl }:
-
Test
strictDeps = truein CI with both Linux and macOS builds -
Consider adding back RPATH handling if runtime linking issues occur:
postFixup = lib.optionalString (!stdenv.hostPlatform.isDarwin) '' patchelf --set-rpath "${lib.getLib openssl}/lib" $out/bin/${x} '';
-
Verify OpenSSL linking works correctly with
OPENSSL_NO_VENDOR=1
Overall Assessment
The changes appear to modernize the build system but introduce potential risks with the lock file manipulation and strict dependency enforcement. Recommend thorough testing before merging.
There was a problem hiding this comment.
Code Review
This pull request updates the project's Nix dependencies in flake.lock and refactors the package build configuration in nix/packages.nix to use openssl instead of stdenv.cc.cc.lib. It also enables strictDeps and sets env.OPENSSL_NO_VENDOR. One issue was identified in nix/packages.nix where env.OPENSSL_NO_VENDOR is set to an integer (1) instead of a string ("1"), which can cause Nix evaluation errors.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Issue
The current
flake.lockpins an older rust toolchain which no longer builds the currentCargo.lockdependencies.Furthermore
openssl-sysstarted using vendored openssl and failed becauseperlwasn't in the nix build environment.Fix
OPENSSL_NO_VENDOR=1soopenssl-sysuses the openssl provided by nixpkgs viapkg-config.Tests
nix flake checknix buildnix shellnix develop