From c8a8b7a8976dc6d767c1be623f0802f8785905b2 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Wed, 17 Jan 2024 00:58:01 +0000 Subject: [PATCH] add postgres to swan --- hosts/swan/default.nix | 1 + modules/nixos/services/default.nix | 1 + modules/nixos/services/postgresql.nix | 16 ++++++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 modules/nixos/services/postgresql.nix diff --git a/hosts/swan/default.nix b/hosts/swan/default.nix index 8b16a30..f058fe9 100644 --- a/hosts/swan/default.nix +++ b/hosts/swan/default.nix @@ -82,6 +82,7 @@ inputs.nixpkgs.lib.nixosSystem { services.vmagent.enable = true; services.samba.enable = true; services.paperless.enable = true; + services.postgresql.enable = true; # Allows private remote access over the internet cloudflareTunnel = { diff --git a/modules/nixos/services/default.nix b/modules/nixos/services/default.nix index 02543c4..fa22ac8 100644 --- a/modules/nixos/services/default.nix +++ b/modules/nixos/services/default.nix @@ -24,6 +24,7 @@ ./netdata.nix ./nextcloud.nix ./paperless.nix + ./postgresql.nix ./prometheus.nix ./samba.nix ./secrets.nix diff --git a/modules/nixos/services/postgresql.nix b/modules/nixos/services/postgresql.nix new file mode 100644 index 0000000..f05fe78 --- /dev/null +++ b/modules/nixos/services/postgresql.nix @@ -0,0 +1,16 @@ +{ config, ... }: { + + services.postgresql = { + settings = { }; + identMap = ""; + ensureUsers = [{ + name = config.user; + ensureClauses = { + createdb = true; + createrole = true; + login = true; + }; + }]; + }; + +}