1 { config, lib, pkgs, ... }:
7 cfg = config.services.openarc;
9 defaultSock = "local:/run/openarc/openarc.sock";
13 ] ++ optionals (cfg.configFile != null) [ "-c" cfg.configFile ];
26 description = "Whether to enable the OpenARC sender authentication system.";
31 default = defaultSock;
32 description = "Socket which is used for communication with OpenARC.";
37 default = "opendmarc";
38 description = "User for the daemon.";
43 default = "opendmarc";
44 description = "Group for the daemon.";
47 configFile = mkOption {
48 type = types.nullOr types.path;
50 description = "Additional OpenARC configuration.";
60 config = mkIf cfg.enable {
62 users.users = optionalAttrs (cfg.user == "openarc") (singleton
65 uid = config.ids.uids.openarc;
68 users.groups = optionalAttrs (cfg.group == "openarc") (singleton
70 gid = config.ids.gids.openarc;
73 environment.systemPackages = [ pkgs.openarc ];
75 systemd.services.openarc = {
76 description = "OpenARC daemon";
77 after = [ "network.target" ];
78 wantedBy = [ "multi-user.target" ];
81 ExecStart = "${pkgs.openarc}/bin/openarc ${escapeShellArgs args}";
84 RuntimeDirectory = optional (cfg.socket == defaultSock) "openarc";
85 PermissionsStartOnly = true;