summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-12-24 22:19:05 +0000
committerAlyssa Ross <hi@alyssa.is>2020-01-10 21:49:06 +0000
commit59c4035e58e0ff224bee2f20c0f6811a71a7806f (patch)
tree3f9ab2d4ff3a2b821906998b408f8f582046600c
parentb74c26a17f1856735577c29d92939721d542f0f5 (diff)
downloadnixpkgs-59c4035e58e0ff224bee2f20c0f6811a71a7806f.tar
nixpkgs-59c4035e58e0ff224bee2f20c0f6811a71a7806f.tar.gz
nixpkgs-59c4035e58e0ff224bee2f20c0f6811a71a7806f.tar.bz2
nixpkgs-59c4035e58e0ff224bee2f20c0f6811a71a7806f.tar.lz
nixpkgs-59c4035e58e0ff224bee2f20c0f6811a71a7806f.tar.xz
nixpkgs-59c4035e58e0ff224bee2f20c0f6811a71a7806f.tar.zst
nixpkgs-59c4035e58e0ff224bee2f20c0f6811a71a7806f.zip
nixos/spamassassin: allow initPreConf to be a path
Supporting a path here is important because it allows e.g. fetching a
configuration from a URL.  To do this and provide the configuration as
a string, IFD would be necessary.  It's just written into a path
anyway.
-rw-r--r--nixos/modules/services/mail/spamassassin.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/services/mail/spamassassin.nix b/nixos/modules/services/mail/spamassassin.nix
index 107280f7c14..07b3bf0420a 100644
--- a/nixos/modules/services/mail/spamassassin.nix
+++ b/nixos/modules/services/mail/spamassassin.nix
@@ -5,7 +5,6 @@ with lib;
 let
   cfg = config.services.spamassassin;
   spamassassin-local-cf = pkgs.writeText "local.cf" cfg.config;
-  spamassassin-init-pre = pkgs.writeText "init.pre" cfg.initPreConf;
 
   spamdEnv = pkgs.buildEnv {
     name = "spamd-env";
@@ -65,8 +64,9 @@ in
       };
 
       initPreConf = mkOption {
-        type = types.str;
+        type = with types; either str path;
         description = "The SpamAssassin init.pre config.";
+        apply = val: if builtins.isPath val then val else pkgs.writeText "init.pre" val;
         default =
         ''
           #