Skip to content
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

Fix overlay on NixOS 24.11 #945

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Conversation

miketth
Copy link
Contributor

@miketth miketth commented Dec 31, 2024

🐟 What?

This PR fixes the overlay, so that binary caches work on NixOS 24.11.

🎣 Why?

It seems that using pkgs.stdenv.hostPlatform (if pkgs is from nixos-24.11) when importing inputs.nixpkgs (nixpkgs-unstable) causes the output hashes to diverge. This PR makes sure that we always use stdenv.hostPlatform from the Flake nixpkgs when using the Flake nixpkgs and not cross-compiling.

🍥 Pending

  • Complain with linter;
  • Remove some temporary fix;
  • Publishing to news' channel.

🐳 Extras

I tested this on my system and it fixed the output hashes mismatching and thus fixed the binary cache.

The "Why am I building a kernel?" section was really helpful while debugging this. Thanks!

@miketth miketth requested a review from a team as a code owner December 31, 2024 21:07
Copy link
Member

@PedroHLC PedroHLC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is good, the reason is bad. I don't endorse mixing stable NixOS with our modules (that targets unstable).

@@ -20,7 +20,7 @@ let
else
import "${flakes.nixpkgs}" {
inherit (cfg.flakeNixpkgs) config;
localSystem = stdenv.hostPlatform;
localSystem = flakes.nixpkgs.legacyPackages."${pkgs.system}".stdenv.hostPlatform;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to have to test this change a little because pkgs.system does not exist in every scenario.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miketth This is the original reference to a system's pkgs without system: #143 (comment), later fixed in #144 + #151. I guess the solution here is to use pkgs.stdenv.hostPlatform.system.

@miketth
Copy link
Contributor Author

miketth commented Dec 31, 2024

Ah, sorry if 24.11 (or any stable release) is unsupported. I can use the packages directly from legacyPackages too, so feel free to close if this is out of scope.

@miketth miketth force-pushed the fix-overlay-on-24-11 branch from bd6d470 to dec0803 Compare January 7, 2025 00:32
@@ -20,7 +20,7 @@ let
else
import "${flakes.nixpkgs}" {
inherit (cfg.flakeNixpkgs) config;
localSystem = stdenv.hostPlatform;
localSystem = flakes.nixpkgs.legacyPackages."${pkgs.system}".stdenv.hostPlatform;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miketth This is the original reference to a system's pkgs without system: #143 (comment), later fixed in #144 + #151. I guess the solution here is to use pkgs.stdenv.hostPlatform.system.

@miketth miketth force-pushed the fix-overlay-on-24-11 branch from dec0803 to d2ba3df Compare January 9, 2025 20:34
@miketth
Copy link
Contributor Author

miketth commented Jan 9, 2025

Thanks for the review! I updated it and also rebased to main.

@miketth miketth requested a review from PedroHLC January 9, 2025 20:36
@PedroHLC PedroHLC merged commit 0e0eeb6 into chaotic-cx:main Jan 9, 2025
2 checks passed
@miketth miketth deleted the fix-overlay-on-24-11 branch January 9, 2025 21:28
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.

2 participants