···1017 # systemd clean --what=state is used to delete the account, so long as the user
1018 # then runs one of the cert services, there won't be any issues.
1019 accountTargets = lib.mapAttrs' (hash: confs: let
1020- leader = "acme-${(builtins.head confs).cert}.service";
1021- dependantServices = map (conf: "acme-${conf.cert}.service") (builtins.tail confs);
001022 in lib.nameValuePair "acme-account-${hash}" {
1023- requiredBy = dependantServices;
1024- before = dependantServices;
1025 requires = [ leader ];
1026 after = [ leader ];
1027 }) (lib.groupBy (conf: conf.accountHash) (lib.attrValues certConfigs));
···1017 # systemd clean --what=state is used to delete the account, so long as the user
1018 # then runs one of the cert services, there won't be any issues.
1019 accountTargets = lib.mapAttrs' (hash: confs: let
1020+ dnsConfs = builtins.filter (conf: cfg.certs.${conf.cert}.dnsProvider != null) confs;
1021+ leaderConf = if dnsConfs != [ ] then builtins.head dnsConfs else builtins.head confs;
1022+ leader = "acme-${leaderConf.cert}.service";
1023+ followers = map (conf: "acme-${conf.cert}.service") (builtins.filter (conf: conf != leaderConf) confs);
1024 in lib.nameValuePair "acme-account-${hash}" {
1025+ requiredBy = followers;
1026+ before = followers;
1027 requires = [ leader ];
1028 after = [ leader ];
1029 }) (lib.groupBy (conf: conf.accountHash) (lib.attrValues certConfigs));