From 01640b7232c78ff3f7b2fd0c284078248069dd8a Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Sun, 19 May 2024 05:16:54 -0400 Subject: [PATCH] Infini-DL360/postgresql: init --- hosts/Infini-DL360/default.nix | 1 + hosts/Infini-DL360/postgresql.nix | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 hosts/Infini-DL360/postgresql.nix diff --git a/hosts/Infini-DL360/default.nix b/hosts/Infini-DL360/default.nix index 8fe7a76..c718959 100644 --- a/hosts/Infini-DL360/default.nix +++ b/hosts/Infini-DL360/default.nix @@ -10,6 +10,7 @@ ./forgejo.nix ./freshrss.nix ./jellyfin.nix + ./postgresql.nix ./thelounge.nix ./vaultwarden.nix ]; diff --git a/hosts/Infini-DL360/postgresql.nix b/hosts/Infini-DL360/postgresql.nix new file mode 100644 index 0000000..efe9f5d --- /dev/null +++ b/hosts/Infini-DL360/postgresql.nix @@ -0,0 +1,13 @@ +{ pkgs, config, lib, ... }: +let + directory = "/srv/postgresql"; +in +{ + persist.directories = [ { inherit directory; user = "postgres"; group = "postgresl"; } ]; + + services.postgresql = { + enable = true; + package = pkgs.postgresql_16; + dataDir = "${directory}/${config.services.postgresql.package.psqlSchema}"; + }; +}