add postgresql container
This commit is contained in:
parent
c00e75f6ce
commit
ef18307232
3 changed files with 35 additions and 0 deletions
7
containers/postgresql-configuration.nix
Normal file
7
containers/postgresql-configuration.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{ system, ... }:
|
||||||
|
{
|
||||||
|
inherit system;
|
||||||
|
config = import ./postgresql.nix;
|
||||||
|
autoStart = true;
|
||||||
|
privateNetwork = true;
|
||||||
|
}
|
27
containers/postgresql.nix
Normal file
27
containers/postgresql.nix
Normal 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";
|
||||||
|
}
|
|
@ -149,6 +149,7 @@
|
||||||
let
|
let
|
||||||
containerNames = [
|
containerNames = [
|
||||||
"default"
|
"default"
|
||||||
|
"postgresql"
|
||||||
];
|
];
|
||||||
containerArches = [
|
containerArches = [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
|
|
Loading…
Reference in a new issue