From da5378d4bd123363a7d7c78304a1e5de5d9feb80 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Wed, 1 Apr 2026 13:07:26 -0700 Subject: [PATCH] qemu: add u2fEmuSupport option using libu2f-emu Adds a u2fEmuSupport flag (default: false) to enable the u2f-emulated virtual USB device in QEMU, backed by libu2f-emu. This allows NixOS VM tests to use a software FIDO/U2F token without hardware. --- pkgs/by-name/qe/qemu/package.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/by-name/qe/qemu/package.nix b/pkgs/by-name/qe/qemu/package.nix index 5dde5e581158..be472939ad21 100644 --- a/pkgs/by-name/qe/qemu/package.nix +++ b/pkgs/by-name/qe/qemu/package.nix @@ -92,6 +92,8 @@ fuse3, canokeySupport ? false, canokey-qemu, + u2fEmuSupport ? false, + libu2f-emu, capstoneSupport ? !minimal, capstone, valgrindSupport ? false, @@ -245,6 +247,7 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals uringSupport [ liburing ] ++ lib.optionals fuseSupport [ fuse3 ] ++ lib.optionals canokeySupport [ canokey-qemu ] + ++ lib.optionals u2fEmuSupport [ libu2f-emu ] ++ lib.optionals capstoneSupport [ capstone ] ++ lib.optionals valgrindSupport [ valgrind-light ]; @@ -329,6 +332,7 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional uringSupport "--enable-linux-io-uring" ++ lib.optional fuseSupport "--enable-fuse" ++ lib.optional canokeySupport "--enable-canokey" + ++ lib.optional u2fEmuSupport "--enable-u2f" ++ lib.optional capstoneSupport "--enable-capstone" ++ lib.optional (!pluginsSupport) "--disable-plugins" ++ lib.optional (!enableBlobs) "--disable-install-blobs"