X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fdatabases%2Fpostgresql.nix;h=a6c4cc998fdb138ccf53671992a916794b6eff95;hb=4c4652aabf2cb3ac8b40f2856eca07a1df9c27e0;hp=c442a63c01b727913b41f5e275c130fd918497db;hpb=258dd18bac4bf5dd03cf1098ffa35cb954f9e015;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/databases/postgresql.nix b/modules/private/databases/postgresql.nix index c442a63..a6c4cc9 100644 --- a/modules/private/databases/postgresql.nix +++ b/modules/private/databases/postgresql.nix @@ -178,9 +178,8 @@ in { ''; }; - secrets.keys = [ - { - dest = "postgresql/pam"; + secrets.keys = { + "postgresql/pam" = { permissions = "0400"; group = "postgres"; user = "postgres"; @@ -192,9 +191,8 @@ in { pam_filter ${filter} ssl start_tls ''; - } - { - dest = "postgresql/pam_replication"; + }; + "postgresql/pam_replication" = { permissions = "0400"; group = "postgres"; user = "postgres"; @@ -206,22 +204,22 @@ in { pam_login_attribute cn ssl start_tls ''; - } - ]; + }; + }; security.pam.services = let pam_ldap = "${pkgs.pam_ldap}/lib/security/pam_ldap.so"; in { postgresql = { text = '' - auth required ${pam_ldap} config=${config.secrets.location}/postgresql/pam - account required ${pam_ldap} config=${config.secrets.location}/postgresql/pam + auth required ${pam_ldap} config=${config.secrets.fullPaths."postgresql/pam"} + account required ${pam_ldap} config=${config.secrets.fullPaths."postgresql/pam"} ''; }; postgresql_replication = { text = '' - auth required ${pam_ldap} config=${config.secrets.location}/postgresql/pam_replication - account required ${pam_ldap} config=${config.secrets.location}/postgresql/pam_replication + auth required ${pam_ldap} config=${config.secrets.fullPaths."postgresql/pam_replication"} + account required ${pam_ldap} config=${config.secrets.fullPaths."postgresql/pam_replication"} ''; }; };