summaryrefslogtreecommitdiffstats
path: root/nixos/modules
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/databases/postgresql.nix8
-rw-r--r--nixos/modules/virtualisation/nixos-containers.nix4
2 files changed, 7 insertions, 5 deletions
diff --git a/nixos/modules/services/databases/postgresql.nix b/nixos/modules/services/databases/postgresql.nix
index d49cb4c51a72..2919022496a3 100644
--- a/nixos/modules/services/databases/postgresql.nix
+++ b/nixos/modules/services/databases/postgresql.nix
@@ -289,14 +289,16 @@ in
port = cfg.port;
};
- services.postgresql.package =
+ services.postgresql.package = let
+ mkThrow = ver: throw "postgresql_${ver} was removed, please upgrade your postgresql version.";
+ in
# Note: when changing the default, make it conditional on
# ‘system.stateVersion’ to maintain compatibility with existing
# systems!
mkDefault (if versionAtLeast config.system.stateVersion "21.11" then pkgs.postgresql_13
else if versionAtLeast config.system.stateVersion "20.03" then pkgs.postgresql_11
- else if versionAtLeast config.system.stateVersion "17.09" then pkgs.postgresql_9_6
- else throw "postgresql_9_5 was removed, please upgrade your postgresql version.");
+ else if versionAtLeast config.system.stateVersion "17.09" then mkThrow "9_6"
+ else mkThrow "9_5");
services.postgresql.dataDir = mkDefault "/var/lib/postgresql/${cfg.package.psqlSchema}";
diff --git a/nixos/modules/virtualisation/nixos-containers.nix b/nixos/modules/virtualisation/nixos-containers.nix
index 279c96567353..0838a57f0f37 100644
--- a/nixos/modules/virtualisation/nixos-containers.nix
+++ b/nixos/modules/virtualisation/nixos-containers.nix
@@ -716,9 +716,9 @@ in
{ config =
{ config, pkgs, ... }:
{ services.postgresql.enable = true;
- services.postgresql.package = pkgs.postgresql_9_6;
+ services.postgresql.package = pkgs.postgresql_10;
- system.stateVersion = "17.03";
+ system.stateVersion = "21.05";
};
};
}