nixos: services: postgresql: persist data

This commit is contained in:
Bruno BELANYI 2021-11-03 17:13:13 +01:00
parent ee6cc339b9
commit 02b47e2cff

View file

@ -18,6 +18,13 @@ in
};
})
# Only persist directory if the actual service is enabled
(lib.mkIf config.services.postgresql.enable {
my.system.persist.directories = [
config.services.postgresql.dataDir
];
})
# Taken from the manual
(lib.mkIf cfg.upgradeScript {
containers.temp-pg.config.services.postgresql = {