BUG: nixpkgs.hostPlatform is missing.
Open
Nobody has claimed this yet.
- Dominant language
- Nix
- Stars
- 628
- Forks
- 64
- PR merge metrics
- No merged PRs in 30d
Description
I updated my flake, after that I got this error:
error:
… while evaluating the attribute 'Yon.config.nixpkgs'
at /nix/store/irknf7niks2djxz4csh7sr44wwrs082y-source/lib/modules.nix:334:9:
333| options = checked options;
334| config = checked (removeAttrs config [ "_module" ]);
| ^
335| _module = checked (config._module);
… while calling the 'seq' builtin
at /nix/store/irknf7niks2djxz4csh7sr44wwrs082y-source/lib/modules.nix:334:18:
333| options = checked options;
334| config = checked (removeAttrs config [ "_module" ]);
| ^
335| _module = checked (config._module);
… while evaluating the option `_module.check':
… while evaluating definitions from `/nix/store/irknf7niks2djxz4csh7sr44wwrs082y-source/nixos/modules/rename.nix':
… while evaluating the module argument `pkgs' in "/nix/store/irknf7niks2djxz4csh7sr44wwrs082y-source/nixos/modules/programs/pay-respects.nix":
… while evaluating definitions from `/nix/store/irknf7niks2djxz4csh7sr44wwrs082y-source/flake.nix':
… while evaluating the option `_module.check':
… while evaluating definitions from `/nix/store/irknf7niks2djxz4csh7sr44wwrs082y-source/nixos/modules/rename.nix':
… while evaluating the module argument `pkgs' in "/nix/store/irknf7niks2djxz4csh7sr44wwrs082y-source/nixos/modules/programs/pay-respects.nix":
… while evaluating the option `nixpkgs.localSystem':
… while evaluating the option `nixpkgs.system':
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: Neither nixpkgs.hostPlatform nor the legacy option nixpkgs.system has been set.
You can set nixpkgs.hostPlatform in hardware-configuration.nix by re-running
a recent version of nixos-generate-config.
The option nixpkgs.system is still fully supported for NixOS 22.05 interoperability,
but will be deprecated in the future, so we recommend to set nixpkgs.hostPlatform.
After adding:
nixpkgs..hostPlatform = lib.mkDefault "x86_64-linux";
to my system, everything worked again.
Maybe this could be automatically set by this lib.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported flake evaluation and inspect flake.nix together with the system configuration that produces the missing nixpkgs.hostPlatform error. Done means the library handles this configuration without requiring a manual hostPlatform setting, with the relevant evaluation succeeding.
Written by the indexing model from the issue text.
Assessment
- Domain
- operating-systems, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100