2021-01-31 18:02:21 -08:00
|
|
|
{ stdenv, lib, makeWrapper, gnupg, coreutils, utillinux, unixtools }:
|
2020-07-06 07:30:09 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "sops-init-gpg-key";
|
|
|
|
version = "0.1.0";
|
|
|
|
src = ./sops-init-gpg-key;
|
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -m755 -D $src $out/bin/sops-init-gpg-key
|
|
|
|
wrapProgram $out/bin/sops-init-gpg-key \
|
2021-01-31 18:02:21 -08:00
|
|
|
--prefix PATH : ${lib.makeBinPath [
|
2020-07-23 08:45:09 +01:00
|
|
|
coreutils utillinux gnupg unixtools.hostname
|
|
|
|
]}
|
2020-07-06 07:30:09 +01:00
|
|
|
'';
|
2020-07-23 08:20:08 +01:00
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/sops-init-gpg-key --hostname server01 --gpghome $TMPDIR/key
|
|
|
|
'';
|
2020-07-06 07:30:09 +01:00
|
|
|
}
|