krebs.exim: validate config file syntax

This commit is contained in:
tv 2016-05-21 11:18:24 +02:00
parent ace70674aa
commit 97c2e4bbd9
2 changed files with 9 additions and 1 deletions
krebs

View file

@ -37,7 +37,7 @@ in {
};
config = lib.mkIf cfg.enable {
environment = {
etc."exim.conf".text = ''
etc."exim.conf".source = pkgs.writeEximConfig "exim.conf" ''
exim_user = ${cfg.user.name}
exim_group = ${cfg.group.name}
exim_path = /var/setuid-wrappers/exim

View file

@ -56,6 +56,14 @@ rec {
'';
};
writeEximConfig = name: text: pkgs.runCommand name {
inherit text;
passAsFile = [ "text" ];
} ''
${pkgs.exim}/bin/exim -C "$textPath" -bV >/dev/null
mv "$textPath" $out
'';
writeNixFromCabal = name: path: pkgs.runCommand name {} ''
${pkgs.cabal2nix}/bin/cabal2nix ${path} > $out
'';