Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
37 lines
927 B
Nix
37 lines
927 B
Nix
# Minica can provide a CA key and cert, plus a key
|
|
# and cert for our fake CA server's Web Front End (WFE).
|
|
{
|
|
pkgs ? import <nixpkgs> { },
|
|
minica ? pkgs.minica,
|
|
mkDerivation ? pkgs.stdenv.mkDerivation,
|
|
}:
|
|
let
|
|
conf = import ./snakeoil-certs.nix;
|
|
domain = conf.domain;
|
|
in
|
|
mkDerivation {
|
|
name = "test-certs";
|
|
buildInputs = [
|
|
(minica.overrideAttrs (_old: {
|
|
prePatch = ''
|
|
sed -i 's_NotAfter: time.Now().AddDate(2, 0, 30),_NotAfter: time.Now().AddDate(20, 0, 0),_' main.go
|
|
'';
|
|
}))
|
|
];
|
|
dontUnpack = true;
|
|
|
|
buildPhase = ''
|
|
minica \
|
|
--ca-key ca.key.pem \
|
|
--ca-cert ca.cert.pem \
|
|
--domains ${domain},accounts.${domain},albums.${domain},api.${domain},cast.${domain},photos.${domain},s3.${domain}
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
mv ca.*.pem $out/
|
|
mv ${domain}/key.pem $out/${domain}.key.pem
|
|
mv ${domain}/cert.pem $out/${domain}.cert.pem
|
|
'';
|
|
}
|