Quickemu complaining about no EFI firmware

I recently installed quickemu using home-manager, but when I try to run a linux or windows vm, I get the following message:

ERROR! EFI boot requested but no EFI firmware found.
       Please install OVMF firmware.

I even tried installing OVMFFull but that didn’t help.

I am able to run a macos vm without getting this error.

It looks like there is a fix in version 3.11.
https://github.com/NixOS/nixpkgs/pull/149409
I ran a sudo nixos-rebuild switch --upgrade and a home-manager switch, but quickemu did not update. Is it possible to update to 3.11 manually/temporarily?

Hi, I am the maintainer of Quickemu in Nixpkgs, and yes, there has been a fix for that bug since 3.11. I recently bumped it to 3.14 as well. I assume you are using NixOS stable, as 3.14 is in unstable, and 2.2.7 is only in stable. Therefore, you could either fix this by going to unstable, or as follows:

Add the unstable channel

sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos-unstable
sudo nix-channel --update

Add this to your configuration.nix:

let
  unstable = import <nixos-unstable> { config = { allowUnfree = true; }; };
in {
  environment.systemPackages = with pkgs; [
    unstable.quickemu
  ];
}

Source: Installing only a single package from `unstable` - #2 by dalto

Thanks for the help!

What would be the 'home-manager’y way to do this? I added and updated the channel as you suggested, using sudo. Then, I tried adding this to home.nix:

{ config, pkgs, ... }:

let
  unstable = import <nixos-unstable> { config = { allowUnfree = true; }; };
in {
  home.packages = with pkgs; [
    unstable.quickemu
  ];
}

but get this error:

❯ home-manager switch
error: attempt to call something which is not a function but a set, at /home/user/.config/nixpkgs/home.nix:5:4
(use '--show-trace' to show detailed location information)

Oh, I assumed you where on NixOS. In that case it should be the same, except instead of

sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos-unstable
sudo nix-channel --update

it’s

nix-channel --add https://nixos.org/channels/nixos-unstable nixos-unstable
nix-channel --update

I am on NixOS, and I am using home-manager. I have installed quickemu in home.nix, so I thought I could install unstable.quickemu in home.nix as well.

So I tried your suggestion above, but get the same error. Is it possible to install packages from the unstable channel using home.nix, or do I have to do it in configuration.nix?

Ah, got it. So yeah, home-manager is looking for the channel in your home, but when you run the command with sudo it adds it to root’s home, if that makes sense.

Same advice works though, just run the commands without sudo.

Yes, I kinda understood that, but as I said, I tried your suggestion above (running the nix-channel commands without sudo), and adding the lines to home.nix as I showed above, but I still get the same error as above.

Could you do me a favor and run the following and post the outputs?

quickemu --version
nixos-version
nix --version
❯ quickemu --version
2.2.7
❯ nixos-version
21.11.336824.ccb90fb9e11 (Porcupine)
❯ nix --version
nix (Nix) 2.3.16

Ok, can you past your nix-channel --update and home-manager switch outputs?

❯ nix-channel --update
unpacking channels...
❯ home-manager switch
error: attempt to call something which is not a function but a set, at /home/user/.config/nixpkgs/home.nix:5:4
(use '--show-trace' to show detailed location information)
❯ head ~/.config/nixpkgs/home.nix
{ config, pkgs, ... }:

let
  unstable = import <nixos-unstable> { config = { allowUnfree = true; }; };
in {
  home.packages = with pkgs; [
    unstable.quickemu
  ];
}

Ok, for whatever reason Home Manager does not like that. Would you mind running home-manager switch -v for more verbose output?

❯ home-manager switch -v
error: while evaluating the attribute 'activationPackage' at /home/user/.nix-defexpr/channels/home-manager/modules/default.nix:54:3:
while evaluating 'showWarnings' at /home/user/.nix-defexpr/channels/home-manager/modules/default.nix:18:18, called from /home/user/.nix-defexpr/channels/home-manager/modules/default.nix:39:12:
while evaluating 'foldr' at /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/lists.nix:52:20, called from /home/user/.nix-defexpr/channels/home-manager/modules/default.nix:22:7:
while evaluating 'fold'' at /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/lists.nix:55:15, called from /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/lists.nix:59:8:
while evaluating 'collectFailed' at /home/user/.nix-defexpr/channels/home-manager/modules/default.nix:15:19, called from /home/user/.nix-defexpr/channels/home-manager/modules/default.nix:41:16:
while evaluating the attribute 'config' at /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:236:9:
while evaluating 'mapAttrsRecursiveCond' at /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/attrsets.nix:296:36, called from /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:171:28:
while evaluating 'recurse' at /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/attrsets.nix:298:23, called from /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/attrsets.nix:306:8:
while evaluating the attribute 'matchedOptions' at /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:487:14:
while evaluating 'flip' at /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/trivial.nix:138:16, called from /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:455:23:
while evaluating 'byName' at /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:424:25, called from /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:443:21:
while evaluating 'reverseList' at /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/lists.nix:393:17, called from /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:163:33:
while evaluating anonymous function at /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:313:37, called from /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:159:25:
while evaluating 'filterModules' at /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:303:36, called from /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:314:7:
while evaluating anonymous function at /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:307:31, called from undefined position:
while evaluating 'loadModule' at /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:249:53, called from /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:290:22:
while evaluating 'unifyModuleSyntax' at /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:318:34, called from /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:255:14:
while evaluating 'applyIfFunction' at /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:348:29, called from /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:255:59:
while evaluating anonymous function at /home/user/.config/nixpkgs/home.nix:1:1, called from /nix/store/47miqdwqv7jcva048yklidady9pw2l3g-nixos-21.11.336824.ccb90fb9e11/nixos/lib/modules.nix:372:8:
attempt to call something which is not a function but a set, at /home/user/.config/nixpkgs/home.nix:5:4

Oh, it seems to complain similarly if I use configuration.nix instead of home-mananger. I added the unstable channel to root, modified configuration.nix and this is what I got:

❯ sudo nixos-rebuild switch
error: attempt to call something which is not a function but a set, at /etc/nixos/configuration.nix:5:4
(use '--show-trace' to show detailed location information)
building Nix...
error: attempt to call something which is not a function but a set, at /etc/nixos/configuration.nix:5:4
(use '--show-trace' to show detailed location information)
building the system configuration...
error: attempt to call something which is not a function but a set, at /etc/nixos/configuration.nix:5:4
(use '--show-trace' to show detailed location information)
❯ head /etc/nixos/configuration.nix
{ config, pkgs, ... }:

let
  unstable = import <nixos-unstable> { config = { allowUnfree = true; }; };
in {
  environment.systemPackages = with pkgs; [
    unstable.quickemu
  ];
}

Ok. Sorry I was busy the last couple days. I can confirm that is the correct syntax, but I have no clue why it is not working. Try this:

{ config, pkgs, ... }:

let
  unstable = import <nixpkgs-unstable> { };
in {
  home.packages = with pkgs; [
    ]
    ++ (with unstable;
    quickemu
    ]);
}

Try that and let me know!

There seems to be mismatched [ ] brackets.

I tried deleting the first ] and got this:

❯ home-manager switch
error: syntax error, unexpected CONCAT, at /home/user/.config/nixpkgs/home.nix:7:3
(use '--show-trace' to show detailed location information)

I tried deleting the second ] and got this:

❯ home-manager switch
error: attempt to call something which is not a function but a set, at /home/user/.config/nixpkgs/home.nix:5:4
(use '--show-trace' to show detailed location information)

Ok, I have no clue what is going on here. I will look into this latter, but that should work!

What about just home.packages = [ unstable.quickemu ];

It’s easy to tangle oneself in syntax features which you don’t understand.

Is that not what we tried the first time with

let
  unstable = import <nixos-unstable> { config = { allowUnfree = true; }; };
in {
  environment.systemPackages = with pkgs; [
    unstable.quickemu
  ];
}

I agree, that is not a feature I understand, I got the syntax from a chat room I am in.