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

The option nixpkgs.hostPlatform is used but not defined. #25

Closed
locallycompact opened this issue Mar 7, 2024 · 8 comments · Fixed by #26
Closed

The option nixpkgs.hostPlatform is used but not defined. #25

locallycompact opened this issue Mar 7, 2024 · 8 comments · Fixed by #26

Comments

@locallycompact
Copy link

This happens when trying to use devour like in this job:

https://gitlab.horizon-haskell.net/web/docs.horizon-haskell.net/-/jobs/1418610

@srid
Copy link
Owner

srid commented Mar 7, 2024

See #23

let configForCurrentSystem = cfg: cfg.config.nixpkgs.hostPlatform.system == system;

Is this not how we check the system of a nixos configuration?

You can use nixpkgs.hostPlatform = "x86_64-linux"; in your studiopolis config to resolve this, but I'm wondering if my configForCurrentSystem should be rewritten.

@srid
Copy link
Owner

srid commented Mar 7, 2024

I suppose I should use system:

image

@srid
Copy link
Owner

srid commented Mar 7, 2024

nixpkgs has a mess of system options:

image

@srid
Copy link
Owner

srid commented Mar 7, 2024

cc @roberth - What system option should we use to answer the question "What platform this nixosconfiguration will build/run on?"

@srid
Copy link
Owner

srid commented Mar 7, 2024

@locallycompact Try this in the meanwhile: #26

I believe localSystem should exist for all configurations, but not entirely sure.

@roberth
Copy link

roberth commented Mar 7, 2024

Those options aren't suitable for reading, partly because of nixpkgs.pkgs and partly because of the legacy support.

Use pkgs.stdenv.hostPlatform or pkgs.stdenv.hostPlatform.system if you need it to be a string.

@roberth
Copy link

roberth commented Mar 7, 2024

ie the module argument

@srid
Copy link
Owner

srid commented Mar 7, 2024

No modules are involved, because we are dealing with the final NixOS configuration built by nixosSystem. Okay, so it should be cfg.pkgs.stdenv.hostPlatform.system. Thanks!

https://github.com/srid/devour-flake/pull/26/files

@srid srid closed this as completed in #26 Mar 8, 2024
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 a pull request may close this issue.

3 participants