-
Notifications
You must be signed in to change notification settings - Fork 41
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
Conversation
There was a problem hiding this 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).
modules/common/nyx-overlay.nix
Outdated
@@ -20,7 +20,7 @@ let | |||
else | |||
import "${flakes.nixpkgs}" { | |||
inherit (cfg.flakeNixpkgs) config; | |||
localSystem = stdenv.hostPlatform; | |||
localSystem = flakes.nixpkgs.legacyPackages."${pkgs.system}".stdenv.hostPlatform; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
Ah, sorry if 24.11 (or any stable release) is unsupported. I can use the packages directly from |
bd6d470
to
dec0803
Compare
modules/common/nyx-overlay.nix
Outdated
@@ -20,7 +20,7 @@ let | |||
else | |||
import "${flakes.nixpkgs}" { | |||
inherit (cfg.flakeNixpkgs) config; | |||
localSystem = stdenv.hostPlatform; | |||
localSystem = flakes.nixpkgs.legacyPackages."${pkgs.system}".stdenv.hostPlatform; |
There was a problem hiding this comment.
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
.
dec0803
to
d2ba3df
Compare
Thanks for the review! I updated it and also rebased to main. |
🐟 What?
This PR fixes the overlay, so that binary caches work on NixOS 24.11.
🎣 Why?
It seems that using
pkgs.stdenv.hostPlatform
(ifpkgs
is fromnixos-24.11
) when importinginputs.nixpkgs
(nixpkgs-unstable
) causes the output hashes to diverge. This PR makes sure that we always usestdenv.hostPlatform
from the Flakenixpkgs
when using the Flakenixpkgs
and not cross-compiling.🍥 Pending
🐳 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!