sieve: offload mailserver.loginAccounts.<name>.sieveScript into /nix/store
This simplifies the remaining structure of `cfg.sieveDirectory` a lot and gets us one step closer to removing `activate-virtual-mail-users.service`.
This commit is contained in:
+13
-1
@@ -346,7 +346,19 @@ in
|
||||
"sieve_script default" = {
|
||||
# declarative
|
||||
type = "default";
|
||||
path = "${cfg.sieveDirectory}/%{user}/default.sieve";
|
||||
name = "default";
|
||||
# TODO: Pre-compile Sieve scripts with 'sievec' (requires a Dovecot config in build sandbox)
|
||||
path = "${
|
||||
pkgs.runCommand "declarative-sieve-scripts" { } (
|
||||
''
|
||||
mkdir "$out"
|
||||
''
|
||||
+ lib.concatMapAttrsStringSep "\n" (_: value: ''
|
||||
mkdir "$out/${value.name}"
|
||||
cp -v "${builtins.toFile "default.sieve" value.sieveScript}" "$out/${value.name}/default.sieve"
|
||||
'') (lib.filterAttrs (_: value: value.sieveScript != null) cfg.accounts)
|
||||
)
|
||||
}/%{user}/default.sieve";
|
||||
};
|
||||
|
||||
"sieve_script personal" = {
|
||||
|
||||
Reference in New Issue
Block a user