lol

Merge pull request #33227 from Ekleog/fcron-opensmtpd

fcron module: be compatible with non-wrapped sendmail's, like opensmt…

authored by

Jörg Thalheim and committed by
GitHub
54b16bcd 6f62ca90

+18 -10
+18 -10
nixos/modules/services/scheduling/fcron.nix
··· 90 [ (allowdeny "allow" (cfg.allow)) 91 (allowdeny "deny" cfg.deny) 92 # see man 5 fcron.conf 93 - { source = pkgs.writeText "fcron.conf" '' 94 - fcrontabs = /var/spool/fcron 95 - pidfile = /var/run/fcron.pid 96 - fifofile = /var/run/fcron.fifo 97 - fcronallow = /etc/fcron.allow 98 - fcrondeny = /etc/fcron.deny 99 - shell = /bin/sh 100 - sendmail = /run/wrappers/bin/sendmail 101 - editor = ${pkgs.vim}/bin/vim 102 - ''; 103 target = "fcron.conf"; 104 gid = config.ids.gids.fcron; 105 mode = "0644";
··· 90 [ (allowdeny "allow" (cfg.allow)) 91 (allowdeny "deny" cfg.deny) 92 # see man 5 fcron.conf 93 + { source = 94 + let 95 + isSendmailWrapped = 96 + lib.hasAttr "sendmail" config.security.wrappers; 97 + sendmailPath = 98 + if isSendmailWrapped then "/run/wrappers/bin/sendmail" 99 + else "${config.system.path}/bin/sendmail"; 100 + in 101 + pkgs.writeText "fcron.conf" '' 102 + fcrontabs = /var/spool/fcron 103 + pidfile = /var/run/fcron.pid 104 + fifofile = /var/run/fcron.fifo 105 + fcronallow = /etc/fcron.allow 106 + fcrondeny = /etc/fcron.deny 107 + shell = /bin/sh 108 + sendmail = ${sendmailPath} 109 + editor = ${pkgs.vim}/bin/vim 110 + ''; 111 target = "fcron.conf"; 112 gid = config.ids.gids.fcron; 113 mode = "0644";