Skip to content

fix: replace deprecated nixpkgs.hostPlatform with nixpkgs.system - #149

Closed
Dichgrem wants to merge 1 commit into
numtide:mainfrom
Dichgrem:fix
Closed

fix: replace deprecated nixpkgs.hostPlatform with nixpkgs.system#149
Dichgrem wants to merge 1 commit into
numtide:mainfrom
Dichgrem:fix

Conversation

@Dichgrem

Copy link
Copy Markdown

nixpkgs.hostPlatform is deprecated and triggers evaluation warnings:

evaluation warning: 'hostPlatform' has been renamed to/replaced by 'stdenv.hostPlatform'

Replace with nixpkgs.system in lib/default.nix lines 193, 199, 205.

Verified that nixpkgs.system evaluates correctly in a NixOS module context.

@Dichgrem

Copy link
Copy Markdown
Author

Note: The CI failure (fileSystems."/".fsType) is a pre-existing issue unrelated to this change, also present in previous PRs (e.g. #148).

@r-vdp

r-vdp commented Apr 15, 2026

Copy link
Copy Markdown
Member

Thanks for the PR, but I think this is chasing the wrong attribute.

The warning you quoted

'hostPlatform' has been renamed to/replaced by 'stdenv.hostPlatform'

is the alias warning for pkgs.hostPlatform — the top-level package-set attribute (pkgs/top-level/aliases.nix). Blueprint reads the NixOS option config.nixpkgs.hostPlatform, which is a different thing and is not deprecated — it's the option NixOS recommends setting (the nixpkgs.system option's own error message says "will be deprecated in the future, so we recommend to set nixpkgs.hostPlatform"). Whatever is emitting that warning in your config is something reading pkgs.hostPlatform, not blueprint.

Switching to config.nixpkgs.system actually regresses things: that option's default throws when only hostPlatform is set (which is what blueprint's templates and docs tell users to do):

$ nix eval .#nixosConfigurations.my-nixos.config.nixpkgs.system
error: Neither nixpkgs.system nor any other option in nixpkgs.* is meant
to be read by modules and configurations.
Use pkgs.stdenv.hostPlatform instead.

The template's toplevel still built in your testing only because nothing in it consumes perSystem; any host module that does perSystem.<anything> would hit that throw.

If we wanted to follow nixpkgs' guidance to the letter, the spelling would be pkgs.stdenv.hostPlatform.system rather than config.nixpkgs.system — but that's a separate issue, not a fix for the warning you saw, so I'll close this one.

(The unrelated fsType CI failure you noted is fixed on main by #151.)

@r-vdp r-vdp closed this Apr 15, 2026
@Dichgrem
Dichgrem deleted the fix branch April 15, 2026 11:30
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