{ writeScript, nix, cacert }:
writeScript "nix-daemon" ''
#!/sbin/openrc-run
export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
export NIX_SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
command=${nix}/bin/nix-daemon
command_background=true
pidfile=/run/nix-daemon.pid
mkdir -p /run
''