mirror of
https://github.com/RichieCahill/dotfiles.git
synced 2026-04-17 04:58:19 -04:00
33 lines
710 B
Nix
33 lines
710 B
Nix
let
|
|
vars = import ../vars.nix;
|
|
in
|
|
{
|
|
users = {
|
|
users.postgres = {
|
|
isSystemUser = true;
|
|
group = "postgres";
|
|
uid = 999;
|
|
};
|
|
groups.postgres = {
|
|
gid = 999;
|
|
};
|
|
};
|
|
|
|
virtualisation.oci-containers.containers = {
|
|
postgres = {
|
|
image = "postgres:17";
|
|
ports = [ "5432:5432" ];
|
|
volumes = [ "${vars.media_database}/postgres:/var/lib/postgresql/data" ];
|
|
environment = {
|
|
POSTGRES_USER = "admin";
|
|
POSTGRES_DB = "archive";
|
|
POSTGRES_INITDB_ARGS = "--auth-host=scram-sha-256";
|
|
};
|
|
environmentFiles = [ "${vars.storage_secrets}/docker/postgres" ];
|
|
autoStart = true;
|
|
user = "postgres:postgres";
|
|
};
|
|
};
|
|
|
|
}
|