From ef3cc3097e2e99c5e0d110f00598d2d1e7b5e6ed Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Thu, 5 Oct 2023 22:14:29 +0200 Subject: [PATCH] sarek: initialize postgresql --- hosts/sarek/configuration.nix | 3 ++- hosts/sarek/services/postgresql.nix | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 hosts/sarek/services/postgresql.nix diff --git a/hosts/sarek/configuration.nix b/hosts/sarek/configuration.nix index 39bbd91..b9d21f4 100644 --- a/hosts/sarek/configuration.nix +++ b/hosts/sarek/configuration.nix @@ -6,7 +6,8 @@ (modulesPath + "/virtualisation/proxmox-lxc.nix") ../../base.nix ../../common/metrics-exporters.nix - # ./hardware-configuration.nix + + ./services/postgresql.nix ]; # Boot and console is handled by proxmoxLXC. diff --git a/hosts/sarek/services/postgresql.nix b/hosts/sarek/services/postgresql.nix new file mode 100644 index 0000000..5f73283 --- /dev/null +++ b/hosts/sarek/services/postgresql.nix @@ -0,0 +1,17 @@ +{ config, pkgs, lib, ... }: +{ + services.postgresql = { + enable = true; + enableTCPIP = true; # Expose on the network + }; + + services.postgresqlBackup = { + enable = true; + location = "/backup/postgresql/"; + startAt = "*-*-* 03:15:00"; + backupAll = true; + }; + + + environment.systemPackages = [ config.services.postgresql.package ]; +}