summary refs log tree commit diff
path: root/pkgs/applications/misc/yubioath-flutter/helper.nix
blob: ca0bf4472a4c993b8b90f26803c85f41a855cdd5 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ buildPythonApplication
, python3
, poetry-core
, yubikey-manager
, fido2
, mss
, zxing_cpp
, pillow
, cryptography

, src
, version
, meta
}:

buildPythonApplication {
  pname = "yubioath-flutter-helper";
  inherit src version meta;

  sourceRoot = "${src.name}/helper";
  format = "pyproject";

  nativeBuildInputs = [
    python3.pkgs.pythonRelaxDepsHook
  ];

  pythonRelaxDeps = true;

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace "authenticator-helper" "yubioath-flutter-helper" \
      --replace "0.1.0" "${version}"
  '';

  postInstall = ''
    install -Dm 0755 authenticator-helper.py $out/bin/authenticator-helper
    install -d $out/libexec/helper
    ln -fs $out/bin/authenticator-helper $out/libexec/helper/authenticator-helper
  '';

  propagatedBuildInputs = [
    poetry-core
    yubikey-manager
    fido2
    mss
    zxing_cpp
    pillow
    cryptography
  ];
}