]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/modules/databases/postgresql.nix
Use systemd RuntimeDirectory for postgresql
[perso/Immae/Config/Nix.git] / nixops / modules / databases / postgresql.nix
index 3a58c48c2716f9514a1fe1977f8fab06fecf46db..de0820f238ef1559145c3e64ad0e14858a318ca2 100644 (file)
@@ -1,4 +1,4 @@
-{ lib, pkgs, config, myconfig, mylibs, ... }:
+{ lib, pkgs, config, myconfig,  ... }:
 let
     cfg = config.services.myDatabases;
 in {
@@ -30,11 +30,8 @@ in {
       '';
     };
 
-    system.activationScripts.postgresql = ''
-      install -m 0755 -o postgres -g postgres -d ${myconfig.env.databases.postgresql.socket}
-      '';
-
     systemd.services.postgresql.serviceConfig.SupplementaryGroups = "keys";
+    systemd.services.postgresql.serviceConfig.RuntimeDirectory = "postgresql";
     services.postgresql = rec {
       enable = cfg.postgresql.enable;
       package = pkgs.postgresql;