From 4c4652aabf2cb3ac8b40f2856eca07a1df9c27e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sat, 16 Oct 2021 17:40:07 +0200 Subject: Use attrs for secrets instead of lists --- modules/private/mail/sympa.nix | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'modules/private/mail/sympa.nix') diff --git a/modules/private/mail/sympa.nix b/modules/private/mail/sympa.nix index 5270b69..920daa9 100644 --- a/modules/private/mail/sympa.nix +++ b/modules/private/mail/sympa.nix @@ -34,20 +34,19 @@ in ]; }; - secrets.keys = [ - { - dest = "sympa/db_password"; + secrets.keys = { + "sympa/db_password" = { permissions = "0400"; group = "sympa"; user = "sympa"; text = sympaConfig.postgresql.password; - } - ] - ++ lib.mapAttrsToList (n: v: { - dest = "sympa/data_sources/${n}.incl"; permissions = "0400"; group = "sympa"; user = "sympa"; text = v; + }; + } + // lib.mapAttrs' (n: v: lib.nameValuePair "sympa/data_sources/${n}.incl" { + permissions = "0400"; group = "sympa"; user = "sympa"; text = v; }) sympaConfig.data_sources - ++ lib.mapAttrsToList (n: v: { - dest = "sympa/scenari/${n}"; permissions = "0400"; group = "sympa"; user = "sympa"; text = v; + // lib.mapAttrs' (n: v: lib.nameValuePair "sympa/scenari/${n}" { + permissions = "0400"; group = "sympa"; user = "sympa"; text = v; }) sympaConfig.scenari; users.users.sympa.extraGroups = [ "keys" ]; systemd.slices.mail-sympa = { -- cgit v1.2.3