From 2a1018b001ade69ff539b3cd35494c5075381a63 Mon Sep 17 00:00:00 2001 From: norohind <60548839+norohind@users.noreply.github.com> Date: Tue, 7 Jan 2025 13:24:16 +0100 Subject: [PATCH] init --- tzpfms.nix | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tzpfms.nix diff --git a/tzpfms.nix b/tzpfms.nix new file mode 100644 index 0000000..bf79e38 --- /dev/null +++ b/tzpfms.nix @@ -0,0 +1,49 @@ +{ pkgs ? import {} }: +let + pname = "tzpfms"; + version = "0.4.0"; +in +pkgs.clangStdenv.mkDerivation rec { + inherit pname; + inherit version; + + src = pkgs.fetchgit { + url = "https://git.sr.ht/~nabijaczleweli/tzpfms"; + rev = "v${version}"; + hash = "sha256-pXQzbKq4DiL0WtxeuoMF1EtzRFpR6fVzDR+ubQD8IEI="; + leaveDotGit = true; + fetchSubmodules = true; # required for leaveDotGit to work + }; + + buildInputs = [ + pkgs.zfs.dev + pkgs.tpm2-tss + pkgs.trousers + pkgs.openssl + ]; + + nativeBuildInputs = [ pkgs.pkg-config pkgs.git pkgs.llvm ]; + + buildPhase = '' + make build + ''; + + installPhase = '' + mkdir -p $out/sbin + cp -r out/zfs-tpm-list $out/sbin/ + cp -r out/zfs-tpm1x-change-key $out/sbin/ + cp -r out/zfs-tpm1x-clear-key $out/sbin/ + cp -r out/zfs-tpm1x-load-key $out/sbin/ + cp -r out/zfs-tpm2-change-key $out/sbin/ + cp -r out/zfs-tpm2-clear-key $out/sbin/ + cp -r out/zfs-tpm2-load-key $out/sbin/ + ''; + + meta = with pkgs.lib; { + description = "A tool for secure sharing of ZFS pools."; + homepage = "https://git.sr.ht/~nabijaczleweli/tzpfms"; + license = licenses.mit; # Replace with the correct license if known + maintainers = [ "norohind" ]; + platforms = platforms.linux; + }; +}