1
0
Fork 0
mirror of https://github.com/Mic92/sops-nix.git synced 2024-12-14 11:57:52 +00:00
sops-nix/pkgs/sops-init-gpg-key/default.nix
2022-09-26 16:28:23 +02:00

23 lines
597 B
Nix

{ stdenv, lib, makeWrapper, gnupg, coreutils, util-linux, unixtools }:
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 \
--prefix PATH : ${lib.makeBinPath [
coreutils util-linux gnupg unixtools.hostname
]}
'';
doInstallCheck = true;
installCheckPhase = ''
$out/bin/sops-init-gpg-key --hostname server01 --gpghome $TMPDIR/key
'';
}