mirror of
https://github.com/Mic92/sops-nix.git
synced 2024-12-14 11:57:52 +00:00
23 lines
597 B
Nix
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
|
|
'';
|
|
}
|