mitchellh / nixos-config

My NixOS configurations.
https://twitter.com/mitchellh/status/1346136404682625024
MIT License
1.93k stars 191 forks source link

Bootstrap on intel throws an error during vm/switch #10

Closed lucamaraschi closed 2 years ago

lucamaraschi commented 2 years ago

From a fresh install on VMWare Fusion 12.2.0 (18760249) on an Intel machine, the following error is thrown during the bootstrap phase (make vm/bootstrap) using the latest main branch code without any change (impersonating mitchellh on the VM ;-))

building the system configuration...
error: anonymous function at /nix/store/z2kiwivn50v7ncd4p362g1gjwi2ng2vi-source/lib/mkvm.nix:3:7 called without required argument 'overlays'

       at /nix/store/z2kiwivn50v7ncd4p362g1gjwi2ng2vi-source/flake.nix:44:36:

           43|
           44|     nixosConfigurations.vm-intel = mkVM "vm-intel" rec {
             |                                    ^
           45|       inherit nixpkgs home-manager;
make[1]: *** [vm/switch] Error 1

As per the video, I applied the same settings. The only change I made is in the makefile to disable the step vm/secrets during bootstrap.

niksteff commented 2 years ago

I also ran into this error on the vm-intel build. It seems there is an argument missing in the flake.nix file.

After adding the variable overlays defined in flake.nix to the inherit declaration in line 45 in flake.nix the configuration works. If you take a closer look to the mkvm.nix file you can see in the name declaration the function is expecting the argument. (i suppose). I am in no means a nixOS expert or something - this was just what i could figure out.

Should look like this:

// flake.nix
 44     nixosConfigurations.vm-intel = mkVM "vm-intel" rec {
 45       inherit nixpkgs home-manager overlays; // here overlays seems to be missing 
 46       system = "x86_64-linux";
 47       user   = "mitchellh";
 48     };
lucamaraschi commented 2 years ago

@dNvl thanks for the direction! I was just prepping a PR for this issue with exactly your same finding!

BTW @dNvl have you tried the setup on M1 too?

niksteff commented 2 years ago

@lucamaraschi awesome!

no sadly not, currently i have only acces to an intel based linux machine. I set it up using vmware player.