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

BUG: nixpkgs.hostPlatform is missing. #160

Open
Svenum opened this issue Jan 22, 2025 · 5 comments
Open

BUG: nixpkgs.hostPlatform is missing. #160

Svenum opened this issue Jan 22, 2025 · 5 comments

Comments

@Svenum
Copy link

Svenum commented Jan 22, 2025

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.

@olifloof
Copy link

olifloof commented Jan 22, 2025

hm, weird, it should already set it automatically

@Svenum
Copy link
Author

Svenum commented Jan 22, 2025

I thought too, but after updating it does not anymore.

@stratosgear
Copy link

stratosgear commented Jan 26, 2025

Here for the same reason! :(

I already have:

nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";

defined in my hardware-configuration.nix that is already properly imported from my default.nix in my [hostname] system folder.

Has been working fine, the last year or so.

Sorry unable to debug this any further on my own... :(

@olifloof
Copy link

hm, weird, it should already set it automatically

looking at my config, i do have it set manually

@wasv
Copy link
Contributor

wasv commented Jan 26, 2025

Looks like this is likely unrelated to snowfall. A PR was recently merged to nixpkgs-unstable that broke evaluation for all flakes. NixOS/nixpkgs#376453
Personally I'm going to switch to the latest stable branch for the time being.

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

No branches or pull requests

4 participants