{ 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; }; }