From c6dfb26702fa23aaa1c289af3cf5b61ff0915c73 Mon Sep 17 00:00:00 2001 From: Ilan Joselevich Date: Wed, 14 Jun 2023 21:22:31 +0300 Subject: [PATCH] age-plugin-tpm: init at unstable-2023-05-02 --- .../tools/security/age-plugin-tpm/default.nix | 41 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/tools/security/age-plugin-tpm/default.nix diff --git a/pkgs/tools/security/age-plugin-tpm/default.nix b/pkgs/tools/security/age-plugin-tpm/default.nix new file mode 100644 index 000000000000..d79f8805c943 --- /dev/null +++ b/pkgs/tools/security/age-plugin-tpm/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildGoModule +, fetchFromGitHub +, swtpm +}: + +buildGoModule { + pname = "age-plugin-tpm"; + version = "unstable-2023-05-02"; + + src = fetchFromGitHub { + owner = "Foxboron"; + repo = "age-plugin-tpm"; + rev = "c570739b05c067087c44f651efce6890eedc0647"; + hash = "sha256-xlJtyNAYi/6vBWLsjymFLGfr30w80OplwG2xGTEB118="; + }; + + vendorHash = "sha256-S9wSxw0ZMibCOspgGt5vjzFhPL+bZncjTdIX2mkX5vE="; + + postConfigure = '' + substituteInPlace vendor/github.com/foxboron/swtpm_test/swtpm.go \ + --replace "/usr/share/swtpm/swtpm-create-user-config-files" "${swtpm}/share/swtpm/swtpm-create-user-config-files" + ''; + + nativeCheckInputs = [ + swtpm + ]; + + ldflags = [ + "-s" + "-w" + ]; + + meta = with lib; { + description = "TPM 2.0 plugin for age"; + homepage = "https://github.com/Foxboron/age-plugin-tpm"; + license = licenses.mit; + platforms = platforms.linux; + maintainers = with maintainers; [ kranzes ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9bb2c80d05f2..c31e215d6ca7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6553,6 +6553,8 @@ with pkgs; agebox = callPackage ../tools/security/agebox { }; + age-plugin-tpm = callPackage ../tools/security/age-plugin-tpm { }; + age-plugin-yubikey = darwin.apple_sdk_11_0.callPackage ../tools/security/age-plugin-yubikey { inherit (darwin.apple_sdk_11_0.frameworks) Foundation PCSC IOKit; };