Looks like an issue in my not using or understanding home manager. The above would be fine with NixOS config.
As someone who does use home-manager, this is weird.
@noblman, can you try
let
unstable = (pkgs.lib.debug.traceVal (import <nixos-unstable>)) { config = { allowUnfree = true; }; };
in {
environment.systemPackages = with pkgs; [
unstable.quickemu
];
}
The issue with this is a missing opening bracket after the with unstable;
, by the way. A much better way of doing the above would simply be (since weāre only using one package, and itās in unstable):
{ config, pkgs, ... }:
let
unstable = import <nixpkgs-unstable> { };
in {
home.packages = with unstable; [
quickemu
];
}
But the suggestion is a bit pointless in the first place, the error is clearly complaining about calling <nixpkgs-unstable>
's default.nix
, which wouldnāt be happening if quickemu
wasnāt being pulled from the unstable variable there.
with
is indeed a known anti-pattern that can cause scoping issues, but itās pretty ok to use as long as you stick to only with pkgs
for home.packages
-like things and donāt have any name collisions. Scoping isnāt the problem here, and with
counter-intuitively doesnāt override variables from the existing scope anyway, so thereās no way this is broken.
First, although you mentioned home-manager, I assume this is supposed to go into configuration.nix since it is using environment.systemPackages
.
I tried doing that, and got the following:
āÆ 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...
Thatāsā¦ Odd. Itās not tracing the value. That means itās failing before it resolves the call to unstable, I think, since type errors like this happen during evaluation so traceVal
should have already triggered?
Could you try the following two commands in nix repl
:
unstable = import <nixos-unstable> { config = { allowUnfree = true; }; }
unstable.quickemu
Iād like to figure out whether the issue is with the quickemu
derivation (?), your configuration of nixos-unstable
(??) or something more fundamental about your installation (???). Itād be nice to know where exactly the error comes from.
Given the previous test I assume these will work, and Iāll be very confused. Have you changed what the module system passes around as pkgs
somehow? How are you building a system with just those lines in configuration.nix
anyway - just to test or are you expecting to switch to that config?
It looks like that worked.
āÆ nix repl
Welcome to Nix version 2.3.16. Type :? for help.
nix-repl> unstable = import <nixos-unstable> { config = { allowUnfree = true; }; }
nix-repl> unstable.quickemu
Ā«derivation /nix/store/ispwh8mjksbp5hzrj5cxzzbdj120z319-quickemu-3.14.drvĀ»
nix-repl>
Edit: But now what? I still would like to install the unstable version of quickemu
using home-manager
.
Hi. I finally figured out how to install unstable quickemu 3.15 in my configuration.nix. Not ideal, because I wanted to do it in home.nix, but thatās OK for now.
Finally I can get back to the original problem, which is that quickemu complains that no SecureBoot firmware is found. I thought that this was something that was fixed in later versions? I also tried adding the package OVMF and OVMFFull, but still no go.
How can I get this working?
Ah, I am glad you got that working! Would you mind posting the code so future users can better understand what is going on?
As far as SecureBoot, I was unable to get Windows11 working, but Windows10 is pretty solid. Here is what I did for that:
{ config, pkgs, ... }:
{
nixpkgs = {
overlays = [
(final: prev: {
quickemu = prev.quickemu.override { OVMF = pkgs.OVMFFull.override { secureBoot = true; tpmSupport = true; csmSupport = true; httpSupport = true;}; };
})
];
};
environment.systemPackages = with pkgs; [
quickemu
];
}
I needed to override OVMF to allow for SecureBoot, and passed that override into an override of Quickemu.