about summary refs log tree commit diff
path: root/pkgs/applications/virtualization/qemu/canokey-qemu.nix
blob: 9536b91ba54038c69c5dffdcf7a991cb06ddbece (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{
  lib,
  stdenv,
  fetchFromGitHub,
  cmake,
}:
stdenv.mkDerivation rec {
  pname = "canokey-qemu";
  version = "unstable-2022-06-23";
  rev = "b70af31229f1858089c3366f71b8d771de4a1e84";

  src = fetchFromGitHub {
    owner = "canokeys";
    repo = "canokey-qemu";
    inherit rev;
    fetchSubmodules = true;
    hash = "sha256-VJb59K/skx+DhoJs5qGUu070hAjQZC2Z6hAMXuX0bMw=";
  };

  postPatch = ''
    substituteInPlace canokey-core/CMakeLists.txt \
      --replace "COMMAND git describe --always --tags --long --abbrev=8 --dirty >>" "COMMAND echo '$rev' >>"
  '';

  outputs = [ "out" "dev" ];

  nativeBuildInputs = [ cmake ];

  meta = with lib; {
    homepage = "https://github.com/canokeys/canokey-qemu";
    description = "CanoKey QEMU Virt Card";
    license = licenses.asl20;
    maintainers = with maintainers; [ oxalica ];
  };
}