From 4919ba60c519a8d0a886a619349bd2a4f65e48ee Mon Sep 17 00:00:00 2001 From: Ilan Joselevich Date: Wed, 14 Jun 2023 21:22:31 +0300 Subject: [PATCH 1/3] age-plugin-tpm: init at unstable-2023-05-02 (cherry picked from commit c6dfb26702fa23aaa1c289af3cf5b61ff0915c73) --- .../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 7287d40de49d..fd41ee2b7c9f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6477,6 +6477,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; }; From 8a69500c387f7a147c3441bed5169e7d33f94195 Mon Sep 17 00:00:00 2001 From: Vika Date: Wed, 12 Jul 2023 17:36:57 +0300 Subject: [PATCH 2/3] age-plugin-tpm: unstable-2023-05-02 -> 0.1.0 (cherry picked from commit 5ecef29242fbf2cae6e9eb0d0e0dbc2f25466b77) --- pkgs/tools/security/age-plugin-tpm/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/security/age-plugin-tpm/default.nix b/pkgs/tools/security/age-plugin-tpm/default.nix index d79f8805c943..200a3e67f22d 100644 --- a/pkgs/tools/security/age-plugin-tpm/default.nix +++ b/pkgs/tools/security/age-plugin-tpm/default.nix @@ -4,18 +4,18 @@ , swtpm }: -buildGoModule { +buildGoModule rec { pname = "age-plugin-tpm"; - version = "unstable-2023-05-02"; + version = "0.1.0"; src = fetchFromGitHub { owner = "Foxboron"; repo = "age-plugin-tpm"; - rev = "c570739b05c067087c44f651efce6890eedc0647"; - hash = "sha256-xlJtyNAYi/6vBWLsjymFLGfr30w80OplwG2xGTEB118="; + rev = "v${version}"; + hash = "sha256-Gp7n2/+vgQbsm/En6PQ1to/W6lvFam4Wh3LHdCZnafc="; }; - vendorHash = "sha256-S9wSxw0ZMibCOspgGt5vjzFhPL+bZncjTdIX2mkX5vE="; + vendorHash = "sha256-oZni/n2J0N3ZxNhf+RlUWyWeOFwL4+6KUIk6DQF8YpA="; postConfigure = '' substituteInPlace vendor/github.com/foxboron/swtpm_test/swtpm.go \ From 13c184d38a0fef420cd21c28225a4a64e5d72909 Mon Sep 17 00:00:00 2001 From: Ilan Joselevich Date: Tue, 18 Jul 2023 16:02:44 +0300 Subject: [PATCH 3/3] age-plugin-tpm: add disclaimer about experimentalness (cherry picked from commit dd3fec45d4cc8803d3a1491d0d20b0b5ed6bf4ec) --- pkgs/tools/security/age-plugin-tpm/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/security/age-plugin-tpm/default.nix b/pkgs/tools/security/age-plugin-tpm/default.nix index 200a3e67f22d..89291096db9b 100644 --- a/pkgs/tools/security/age-plugin-tpm/default.nix +++ b/pkgs/tools/security/age-plugin-tpm/default.nix @@ -32,7 +32,7 @@ buildGoModule rec { ]; meta = with lib; { - description = "TPM 2.0 plugin for age"; + description = "TPM 2.0 plugin for age (This software is experimental, use it at your own risk)"; homepage = "https://github.com/Foxboron/age-plugin-tpm"; license = licenses.mit; platforms = platforms.linux;