summaryrefslogtreecommitdiff
path: root/custom/simp_le.nix
blob: 9ff9836497bc77da585f5538a351789a10056006 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ stdenv, writeText
, bash
, simp_le
, eject
}:
dir:
domain:

let
  script = writeText "${domain}.sh" ''
    mkdir -p ${dir}
    cd ${dir}
    ${simp_le}/bin/simp_le -d ${domain}:/srv/www/acme/${domain}/ \
      --email "phikeebaogobaegh@141.li" \
      -f account_key.json \
      -f cert.pem \
      -f fullchain.pem \
      -f key.pem
    [[ -e key.pem ]] && ln -s -f key.pem privkey.pem
  '';
in
  "${bash}/bin/bash ${script} > ${eject}/bin/logger -p auth.info"