nixos/strongswan-swanctl: replace activationScripts via tmpfiles

This commit is contained in:
nikstur 2023-10-20 00:30:45 +02:00
parent 168b967b32
commit 6c800013bf

View File

@ -43,21 +43,21 @@ in {
# The swanctl command complains when the following directories don't exist:
# See: https://wiki.strongswan.org/projects/strongswan/wiki/Swanctldirectory
system.activationScripts.strongswan-swanctl-etc = stringAfter ["etc"] ''
mkdir -p '/etc/swanctl/x509' # Trusted X.509 end entity certificates
mkdir -p '/etc/swanctl/x509ca' # Trusted X.509 Certificate Authority certificates
mkdir -p '/etc/swanctl/x509ocsp'
mkdir -p '/etc/swanctl/x509aa' # Trusted X.509 Attribute Authority certificates
mkdir -p '/etc/swanctl/x509ac' # Attribute Certificates
mkdir -p '/etc/swanctl/x509crl' # Certificate Revocation Lists
mkdir -p '/etc/swanctl/pubkey' # Raw public keys
mkdir -p '/etc/swanctl/private' # Private keys in any format
mkdir -p '/etc/swanctl/rsa' # PKCS#1 encoded RSA private keys
mkdir -p '/etc/swanctl/ecdsa' # Plain ECDSA private keys
mkdir -p '/etc/swanctl/bliss'
mkdir -p '/etc/swanctl/pkcs8' # PKCS#8 encoded private keys of any type
mkdir -p '/etc/swanctl/pkcs12' # PKCS#12 containers
'';
systemd.tmpfiles.rules = [
"d /etc/swanctl/x509 -" # Trusted X.509 end entity certificates
"d /etc/swanctl/x509ca -" # Trusted X.509 Certificate Authority certificates
"d /etc/swanctl/x509ocsp -"
"d /etc/swanctl/x509aa -" # Trusted X.509 Attribute Authority certificates
"d /etc/swanctl/x509ac -" # Attribute Certificates
"d /etc/swanctl/x509crl -" # Certificate Revocation Lists
"d /etc/swanctl/pubkey -" # Raw public keys
"d /etc/swanctl/private -" # Private keys in any format
"d /etc/swanctl/rsa -" # PKCS#1 encoded RSA private keys
"d /etc/swanctl/ecdsa -" # Plain ECDSA private keys
"d /etc/swanctl/bliss -"
"d /etc/swanctl/pkcs8 -" # PKCS#8 encoded private keys of any type
"d /etc/swanctl/pkcs12 -" # PKCS#12 containers
];
systemd.services.strongswan-swanctl = {
description = "strongSwan IPsec IKEv1/IKEv2 daemon using swanctl";