add postgresql container

This commit is contained in:
Charlotte 🦝 Delenk 2024-11-15 13:41:19 +01:00
parent c00e75f6ce
commit ef18307232
3 changed files with 35 additions and 0 deletions

View file

@ -0,0 +1,7 @@
{ system, ... }:
{
inherit system;
config = import ./postgresql.nix;
autoStart = true;
privateNetwork = true;
}

27
containers/postgresql.nix Normal file
View file

@ -0,0 +1,27 @@
{
config,
pkgs,
system,
...
}:
{
imports = [
./default.nix
];
services.postgresql = {
dataDir = "/persistent/${config.services.postgresql.package.psqlSchema}";
enable = true;
enableJIT = system != "riscv64-linux";
enableTCPIP = true;
extraPlugins = ps: with ps; [ rum ];
package =
if config.services.postgresql.enableJIT then pkgs.postgresql_17_jit else pkgs.postgresql_17;
};
services.postgresqlBackup = {
compression = "zstd";
compressionLevel = 19;
enable = true;
location = "/persistent/pgbackup";
};
system.stateVersion = "24.11";
}

View file

@ -149,6 +149,7 @@
let
containerNames = [
"default"
"postgresql"
];
containerArches = [
"x86_64-linux"