summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWael M. Nasreddine <wael.nasreddine@gmail.com>2021-08-18 22:13:23 -0700
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2021-08-21 17:14:04 +0000
commit5794e35b25e47df6a7c5261eabc50dd5f6eabdb8 (patch)
tree4d8e1bbdd8efacef78077ce75127c0d53ce59351
parentMerge pull request #135074 from NixOS/backport-134616-to-release-21.05 (diff)
downloadnixpkgs-5794e35b25e47df6a7c5261eabc50dd5f6eabdb8.tar.gz
onlykey-agent: init at 1.0.2
(cherry picked from commit 8b8cd493ef8e70cdb97d05ce95ba37e75cdea431)
-rw-r--r--pkgs/development/python-modules/libagent/default.nix2
-rw-r--r--pkgs/tools/security/onlykey-agent/default.nix61
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 65 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/libagent/default.nix b/pkgs/development/python-modules/libagent/default.nix
index 5334513e23c8..6fdc286855a1 100644
--- a/pkgs/development/python-modules/libagent/default.nix
+++ b/pkgs/development/python-modules/libagent/default.nix
@@ -2,6 +2,8 @@
unidecode, mock, pytest , backports-shutil-which, ConfigArgParse,
python-daemon, pymsgbox }:
+# XXX: when changing this package, please test the package onlykey-agent.
+
buildPythonPackage rec {
pname = "libagent";
version = "0.14.1";
diff --git a/pkgs/tools/security/onlykey-agent/default.nix b/pkgs/tools/security/onlykey-agent/default.nix
new file mode 100644
index 000000000000..84c65b913458
--- /dev/null
+++ b/pkgs/tools/security/onlykey-agent/default.nix
@@ -0,0 +1,61 @@
+{ lib
+, python3Packages
+, onlykey-cli
+}:
+
+let
+ # onlykey requires a patched version of libagent
+ lib-agent = with python3Packages; libagent.overridePythonAttrs (oa: rec{
+ version = "1.0.2";
+ src = fetchPypi {
+ inherit version;
+ pname = "lib-agent";
+ sha256 = "sha256-NAimivO3m4UUPM4JgLWGq2FbXOaXdQEL/DqZAcy+kEw=";
+ };
+ propagatedBuildInputs = oa.propagatedBuildInputs or [ ] ++ [
+ pynacl
+ docutils
+ pycryptodome
+ wheel
+ ];
+
+ # turn off testing because I can't get it to work
+ doCheck = false;
+ pythonImportsCheck = [ "libagent" ];
+
+ meta = oa.meta // {
+ description = "Using OnlyKey as hardware SSH and GPG agent";
+ homepage = "https://github.com/trustcrypto/onlykey-agent/tree/ledger";
+ maintainers = with maintainers; [ kalbasit ];
+ };
+ });
+in
+python3Packages.buildPythonApplication rec {
+ pname = "onlykey-agent";
+ version = "1.1.11";
+
+ src = python3Packages.fetchPypi {
+ inherit pname version;
+ sha256 = "sha256-YH/cqQOVy5s6dTp2JwxM3s4xRTXgwhOr00whtHAwZZI=";
+ };
+
+ propagatedBuildInputs = with python3Packages; [ lib-agent onlykey-cli ];
+
+ # move the python library into the sitePackages.
+ postInstall = ''
+ mkdir $out/${python3Packages.python.sitePackages}/onlykey_agent
+ mv $out/bin/onlykey_agent.py $out/${python3Packages.python.sitePackages}/onlykey_agent/__init__.py
+ chmod a-x $out/${python3Packages.python.sitePackages}/onlykey_agent/__init__.py
+ '';
+
+ # no tests
+ doCheck = false;
+ pythonImportsCheck = [ "onlykey_agent" ];
+
+ meta = with lib; {
+ description = " The OnlyKey agent is essentially middleware that lets you use OnlyKey as a hardware SSH/GPG device.";
+ homepage = "https://github.com/trustcrypto/onlykey-agent";
+ license = licenses.lgpl3Only;
+ maintainers = with maintainers; [ kalbasit ];
+ };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index f29a0f327e3a..ae55f4c8a71d 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -7347,6 +7347,8 @@ in
onioncircuits = callPackage ../tools/security/onioncircuits { };
+ onlykey-agent = callPackage ../tools/security/onlykey-agent { };
+
onlykey-cli = callPackage ../tools/security/onlykey-cli { };
openapi-generator-cli = callPackage ../tools/networking/openapi-generator-cli { jre = pkgs.jre_headless; };