From bd37b5a807bdddba28aaa641d449f20902bd6171 Mon Sep 17 00:00:00 2001 From: ners Date: Thu, 23 Jan 2025 02:31:01 +0100 Subject: [PATCH 1/2] libu2f-emu: init at 0.1.0 --- pkgs/by-name/li/libu2f-emu/package.nix | 49 ++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 pkgs/by-name/li/libu2f-emu/package.nix diff --git a/pkgs/by-name/li/libu2f-emu/package.nix b/pkgs/by-name/li/libu2f-emu/package.nix new file mode 100644 index 0000000000000..e7afb82e253ff --- /dev/null +++ b/pkgs/by-name/li/libu2f-emu/package.nix @@ -0,0 +1,49 @@ +{ + lib, + stdenv, + fetchFromGitHub, + autoreconfHook, + autoconf-archive, + pkg-config, + openssl, + gtest, + gitUpdater, +}: + +stdenv.mkDerivation rec { + pname = "libu2f-emu"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "eveldun"; + repo = "libu2f-emu"; + tag = version; + hash = "sha256-VExtT1AFJUTNlZ+MdnwpbnY8lMaAtg7q5fD9inVdgK4="; + }; + + nativeBuildInputs = [ + autoreconfHook + autoconf-archive + pkg-config + ]; + + buildInputs = [ + openssl.dev + ]; + + checkInputs = [ + gtest + ]; + + env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; + + passthru.updateScript = gitUpdater { }; + + meta = { + description = "Universal 2nd Factor (U2F) Emulation C Library"; + homepage = "https://github.com/eveldun/libu2f-emu"; + license = lib.licenses.gpl2Only; + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ ners ]; + }; +} From a007b4947151e07967216ed97746e420a7514269 Mon Sep 17 00:00:00 2001 From: ners Date: Thu, 23 Jan 2025 02:32:33 +0100 Subject: [PATCH 2/2] qemu: add u2f support --- pkgs/applications/virtualization/qemu/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index 9aa0c637d2b6b..2af9291e8d999 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -31,6 +31,7 @@ , uringSupport ? stdenv.hostPlatform.isLinux && !userOnly, liburing , canokeySupport ? !minimal, canokey-qemu , capstoneSupport ? !minimal, capstone +, u2fSupport ? !minimal, libu2f-emu , pluginsSupport ? !stdenv.hostPlatform.isStatic , enableDocs ? !minimal || toolsOnly , enableTools ? !minimal || toolsOnly @@ -122,7 +123,8 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals smbdSupport [ samba ] ++ lib.optionals uringSupport [ liburing ] ++ lib.optionals canokeySupport [ canokey-qemu ] - ++ lib.optionals capstoneSupport [ capstone ]; + ++ lib.optionals capstoneSupport [ capstone ] + ++ lib.optionals u2fSupport [ libu2f-emu ]; dontUseMesonConfigure = true; # meson's configurePhase isn't compatible with qemu build dontAddStaticConfigureFlags = true; @@ -192,6 +194,7 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional uringSupport "--enable-linux-io-uring" ++ lib.optional canokeySupport "--enable-canokey" ++ lib.optional capstoneSupport "--enable-capstone" + ++ lib.optional u2fSupport "--enable-u2f" ++ lib.optional (!pluginsSupport) "--disable-plugins" ++ lib.optional (!enableBlobs) "--disable-install-blobs" ++ lib.optional userOnly "--disable-system"