]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/monitoring/default.nix
Stop using overlays in the middle of modules
[perso/Immae/Config/Nix.git] / modules / private / monitoring / default.nix
index 8b45d470325bdb8742d01e0f32003d2f91384c1a..0586567ec326034bb11d61f5f61d5e05c092780e 100644 (file)
@@ -11,6 +11,11 @@ let
       pkgs.mailutils
     ]}
     '';
+  postgresqlBinary = if config.myServices.databasesReplication.postgresql.enable
+    then config.myServices.databasesReplication.postgresql.mainPackage
+    else if config.myServices.databases.enable
+    then config.myServices.databases.postgresql.package
+    else pkgs.postgresql;
   myplugins = pkgs.runCommand "buildplugins" {
     buildInputs = [ pkgs.makeWrapper pkgs.perl ];
   } ''
@@ -28,7 +33,7 @@ let
       pkgs.gnugrep pkgs.gawk pkgs.procps-ng
     ]}
     wrapProgram $out/check_postgres_replication --prefix PATH : ${lib.makeBinPath [
-      pkgs.postgresql
+      postgresqlBinary
     ]}
     wrapProgram $out/check_redis_replication --prefix PATH : ${lib.makeBinPath [
       pkgs.gnugrep pkgs.coreutils pkgs.redis