37 lines
686 B
Nix
37 lines
686 B
Nix
|
|
# unpackPhase
|
||
|
|
# patchPhase
|
||
|
|
# configurePhase
|
||
|
|
# buildPhase
|
||
|
|
# checkPhase
|
||
|
|
# installPhase
|
||
|
|
# fixupPhase
|
||
|
|
# installCheckPhase
|
||
|
|
# distPhase
|
||
|
|
{
|
||
|
|
stdenv,
|
||
|
|
sqlite,
|
||
|
|
cfssl,
|
||
|
|
k8s,
|
||
|
|
all_hostnames,
|
||
|
|
...
|
||
|
|
}:
|
||
|
|
stdenv.mkDerivation (finalAttrs: {
|
||
|
|
name = "k8s-keys";
|
||
|
|
nativeBuildInputs = [ cfssl ];
|
||
|
|
buildInputs = [ ];
|
||
|
|
|
||
|
|
unpackPhase = "true";
|
||
|
|
|
||
|
|
installPhase = ''
|
||
|
|
mkdir -p "$out"
|
||
|
|
cd "$out"
|
||
|
|
cfssl gencert \
|
||
|
|
-ca=${k8s.ca}/ca.pem \
|
||
|
|
-ca-key=${k8s.ca}/ca-key.pem \
|
||
|
|
-config=${./files/ca-config.json} \
|
||
|
|
-hostname=${builtins.concatStringsSep "," all_hostnames} \
|
||
|
|
-profile=kubernetes \
|
||
|
|
${./files/kubernetes-csr.json} | cfssljson -bare kubernetes
|
||
|
|
'';
|
||
|
|
})
|