Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qemu: add u2f support #375966

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pkgs/applications/virtualization/qemu/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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"
Expand Down
49 changes: 49 additions & 0 deletions pkgs/by-name/li/libu2f-emu/package.nix
Original file line number Diff line number Diff line change
@@ -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
ners marked this conversation as resolved.
Show resolved Hide resolved
];

env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would ideally be reported upstream (or a patch sent)


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 ];
};
}
Loading