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/databases/openldap_replication.nix | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'modules/private/databases/openldap_replication.nix') diff --git a/modules/private/databases/openldap_replication.nix b/modules/private/databases/openldap_replication.nix index 350eecf..b456323 100644 --- a/modules/private/databases/openldap_replication.nix +++ b/modules/private/databases/openldap_replication.nix @@ -87,9 +87,8 @@ in }; users.groups.openldap.gid = config.ids.gids.openldap; - secrets.keys = lib.flatten (lib.mapAttrsToList (name: hcfg: [ - { - dest = "openldap_replication/${name}/replication_config"; + secrets.keys = lib.listToAttrs (lib.flatten (lib.mapAttrsToList (name: hcfg: [ + (lib.nameValuePair "openldap_replication/${name}/replication_config" { user = "openldap"; group = "openldap"; permissions = "0400"; @@ -105,15 +104,14 @@ in binddn="${hcfg.dn}" credentials="${hcfg.password}" ''; - } - { - dest = "openldap_replication/${name}/replication_password"; + }) + (lib.nameValuePair "openldap_replication/${name}/replication_password" { user = "openldap"; group = "openldap"; permissions = "0400"; text = hcfg.password; - } - ]) cfg.hosts); + }) + ]) cfg.hosts)); services.cron = { enable = true; -- cgit v1.2.3