X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=inline;f=virtual%2Fmodules%2Fdatabases%2Fdefault.nix;h=0912830d3ff3b1db561761363532d248aff43087;hb=2abb172bacad70f5b7b451df2a1a984bfff4a2da;hp=0e2183704be102a6580769065f4f074529e418f3;hpb=a7f7fdae99f7617fb7fdabe1e65423e02a4982b1;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/virtual/modules/databases/default.nix b/virtual/modules/databases/default.nix index 0e21837..0912830 100644 --- a/virtual/modules/databases/default.nix +++ b/virtual/modules/databases/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, config, mylibs, ... }: +{ lib, pkgs, config, myconfig, mylibs, ... }: let cfg = config.services.myDatabases; in { @@ -57,18 +57,11 @@ in { networking.firewall.allowedTCPPorts = [ 3306 5432 ]; - # FIXME: initial sync - # FIXME: backup - # FIXME: restart after pam - # FIXME: pam access doesn’t work (because of php module) - # FIXME: ssl services.mysql = rec { enable = cfg.mariadb.enable; package = pkgs.mariadb; }; - # Cannot use eldiron: psql complains too much rights on the key, and - # setfacl cannot work properly because of acme prestart script security.acme.certs."postgresql" = config.services.myCertificates.certConfig // { user = "postgres"; group = "postgres"; @@ -83,7 +76,6 @@ in { install -m 0755 -o postgres -g postgres -d /run/postgresql ''; - # FIXME: initial sync services.postgresql = rec { enable = cfg.postgresql.enable; package = pkgs.postgresql; @@ -120,20 +112,18 @@ in { security.pam.services = let pam_ldap = pkgs.pam_ldap; - pam_ldap_mysql = assert mylibs.checkEnv "NIXOPS_MYSQL_PAM_PASSWORD"; - pkgs.writeText "mysql.conf" '' + pam_ldap_mysql = pkgs.writeText "mysql.conf" '' host ldap.immae.eu base dc=immae,dc=eu binddn cn=mysql,cn=pam,ou=services,dc=immae,dc=eu - bindpw ${builtins.getEnv "NIXOPS_MYSQL_PAM_PASSWORD"} + bindpw ${myconfig.env.databases.mysql.pam_password} pam_filter memberOf=cn=users,cn=mysql,cn=pam,ou=services,dc=immae,dc=eu ''; - pam_ldap_postgresql_replication = assert mylibs.checkEnv "NIXOPS_ELDIRON_LDAP_PASSWORD"; - pkgs.writeText "postgresql.conf" '' + pam_ldap_postgresql_replication = pkgs.writeText "postgresql.conf" '' host ldap.immae.eu base dc=immae,dc=eu binddn cn=eldiron,ou=hosts,dc=immae,dc=eu - bindpw ${builtins.getEnv "NIXOPS_ELDIRON_LDAP_PASSWORD"} + bindpw ${myconfig.env.ldap.password} pam_login_attribute cn ''; in [ @@ -161,11 +151,11 @@ in { } ]; - # FIXME: backup # Diaspora: 15 # Nextcloud: 14 # Mastodon: 13 # Mediagoblin: 12 + # wallabag: 0 ? services.redis = rec { enable = config.services.myDatabases.redis.enable; bind = "127.0.0.1";