nixosModule = { config, lib, pkgs, ... }:
let
cfg = config.services.openarc;
- defaultSock = "local:/run/openarc/openarc.sock";
- args = [ "-f" "-p" cfg.socket ] ++ lib.optionals (cfg.configFile != null) [ "-c" cfg.configFile ];
+ defaultSock = "/run/openarc/openarc.sock";
+ args = [ "-f" "-p" "local:${cfg.socket}" ] ++ lib.optionals (cfg.configFile != null) [ "-c" cfg.configFile ];
in {
options = {
services.openarc = {
nixosModule = { config, lib, pkgs, ... }:
let
cfg = config.services.opendmarc;
- defaultSock = "local:/run/opendmarc/opendmarc.sock";
- args = [ "-f" "-l" "-p" cfg.socket ] ++ lib.optionals (cfg.configFile != null) [ "-c" cfg.configFile ];
+ defaultSock = "/run/opendmarc/opendmarc.sock";
+ args = [ "-f" "-l" "-p" "local:${cfg.socket}" ] ++ lib.optionals (cfg.configFile != null) [ "-c" cfg.configFile ];
in {
options = {
services.opendmarc = {
"nixpkgs": "nixpkgs"
},
"locked": {
- "narHash": "sha256-YJREl39cf4zrFdAULMu1Yjg7hIEZCLuCnP8qJvWbIvM=",
+ "narHash": "sha256-HGNP1eH7b42BxViYx/F3ZPO9CM1X+5qfA9JoP2ArN+s=",
"path": "../../lib",
"type": "path"
},
},
"nix-lib": {
"locked": {
- "lastModified": 1629758329,
- "narHash": "sha256-Qdno5vgP0pnc+nEB5DjYGseW+4MuXiJMfc6cHwalCXY=",
+ "lastModified": 1633008342,
+ "narHash": "sha256-wZV5YidnsqV/iufDIhaZip3LzwUGeIt8wtdiGS5+cXc=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "99967a54d893b9742b38809ccfe3172b6918bdef",
+ "rev": "6eae8a116011f4db0aa5146f364820024411d6bb",
"type": "github"
},
"original": {
"openarc": "openarc_2"
},
"locked": {
- "narHash": "sha256-w+MiC+2IBNsXJT9Ln5TBfipv0eCqZOdyY/BYGFVu+nk=",
+ "narHash": "sha256-ilrfNs6jpi1OceDE3y1atkovECx6PKNWubwLc0Sjx+s=",
"path": "../../openarc",
"type": "path"
},
outputs = { self, nix-lib, my-lib, files-watcher, openarc }:
let
cfg = name': { config, lib, pkgs, name, ... }: {
- imports = [ (my-lib.lib.withNarKey files-watcher "nixosModule") ];
+ imports = [
+ (my-lib.lib.withNarKey files-watcher "nixosModule")
+ (my-lib.lib.withNarKey openarc "nixosModule")
+ #FIXME:
+ #(my-lib.lib.withNarKey secrets "nixosModule")
+ ];
config = lib.mkIf (name == name') {
services.openarc = {
enable = true;
user = "opendkim";
- socket = "local:${config.myServices.mail.milters.sockets.openarc}";
+ socket = "/run/openarc/openarc.sock";
group = config.services.postfix.group;
configFile = pkgs.writeText "openarc.conf" ''
AuthservID mail.immae.eu
'';
};
systemd.services.openarc.serviceConfig.Slice = "mail.slice";
- systemd.services.openarc.postStart = lib.optionalString
- (lib.strings.hasPrefix "local:" config.services.openarc.socket) ''
- while [ ! -S ${lib.strings.removePrefix "local:" config.services.openarc.socket} ]; do
+ systemd.services.openarc.postStart = ''
+ while [ ! -S ${config.services.openarc.socket} ]; do
sleep 0.5
done
- chmod g+w ${lib.strings.removePrefix "local:" config.services.openarc.socket}
+ chmod g+w ${config.services.openarc.socket}
'';
services.filesWatcher.openarc = {
restart = true;
},
"nix-lib": {
"locked": {
- "lastModified": 1630358951,
- "narHash": "sha256-y6jh6YDWX6fX88tS9bSFOVSnckCL4qgt7UqUJhLPSx8=",
+ "lastModified": 1633008342,
+ "narHash": "sha256-wZV5YidnsqV/iufDIhaZip3LzwUGeIt8wtdiGS5+cXc=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "2d786792ca69c98a8655858464e53698ad7311e2",
+ "rev": "6eae8a116011f4db0aa5146f364820024411d6bb",
"type": "github"
},
"original": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
- "narHash": "sha256-eIe5hzNsp1zz5m4ZMzORwdHuLkhEsKkS7WMpPOJE4ok=",
+ "narHash": "sha256-7jup/d3+WXXWsNMB7Sp5Py4rJQV30Z5+PJITBISbQ9o=",
"path": "../../opendmarc",
"type": "path"
},
outputs = { self, nix-lib, opendmarc, my-lib, files-watcher }:
let
cfg = name': { config, lib, pkgs, name, ... }: {
- imports = [ (my-lib.lib.withNarKey files-watcher "nixosModule") ];
+ imports = [
+ (my-lib.lib.withNarKey files-watcher "nixosModule")
+ (my-lib.lib.withNarKey opendmarc "nixosModule")
+ #FIXME:
+ #(my-lib.lib.withNarKey secrets "nixosModule")
+ ];
config = lib.mkIf (name == name') {
users.users."${config.services.opendmarc.user}".extraGroups = [ "keys" ];
systemd.services.opendmarc.serviceConfig.Slice = "mail.slice";
services.opendmarc = {
enable = true;
- socket = "local:${config.myServices.mail.milters.sockets.opendmarc}";
+ socket = "/run/opendmarc/opendmarc.sock";
configFile = pkgs.writeText "opendmarc.conf" ''
AuthservID HOSTNAME
FailureReports false
fiche = ./webapps/fiche.nix;
paste = (flakeCompat ../flakes/paste).nixosModule;
- opendmarc = (flakeCompat ../flakes/opendmarc).nixosModule;
- openarc = (flakeCompat ../flakes/openarc).nixosModule;
+ opendmarc = flakeLib.withNarKeyCompat flakeCompat ../flakes/opendmarc "nixosModule";
+ openarc = flakeLib.withNarKeyCompat flakeCompat ../flakes/openarc "nixosModule";
duplyBackup = ./duply_backup;
rsyncBackup = ./rsync_backup;
type = lib.types.attrsOf lib.types.path;
default = {
opendkim = "/run/opendkim/opendkim.sock";
- opendmarc = "/run/opendmarc/opendmarc.sock";
- openarc = "/run/openarc/openarc.sock";
+ opendmarc = config.services.opendmarc.socket;
+ openarc = config.services.openarc.socket;
};
readOnly = true;
description = ''