Continue moving personal packages from overlays

Continue moving out of the overlay model for everything and into running
sutff directly out of the packages. This should give a cleaner
separation of the things that I don't need to maintain separately
This commit is contained in:
Greg Hellings
2024-10-11 12:58:03 -05:00
parent 8d752032ae
commit 6a3f482792
15 changed files with 190 additions and 159 deletions
+32
View File
@@ -0,0 +1,32 @@
{ writeShellApplication, openssl, ... }:
writeShellApplication {
name = "create_ssl";
runtimeInputs = [ openssl ];
text = ''
set -e -o pipefail
name="''${1}"
root_key="''${2}"
function usage {
echo "USAGE: create_ssl <cert name> <root path>"
}
if [ -z "''${name}" ]; then
usage
exit 1
fi
if [ -z "''${root_key}" ]; then
usage
exit 1
fi
# Create the certificate key
openssl ecparam -out "''${name}.key" -name prime256v1 -genkey
# Create the CSR
openssl req -name -sha256 -key "''${name}.key" -out "''${name}.csr"
# Sign it
openssl x509 -req -in "''${name}.csr" -CA "''${root_key}.crt" -CAkey "''${root_key}.key" -CAcreateserial -out "''${name}.crt" -days 3650 -sha256
'';
}