From 570ff894f8b330c73d668416a754c6f5f97e525e Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Sat, 27 May 2023 15:05:20 -0700 Subject: [PATCH] Moved postgresql to seperate file --- hosts/Alaska/default.nix | 1 + hosts/Alaska/modules/postgresql.nix | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 hosts/Alaska/modules/postgresql.nix diff --git a/hosts/Alaska/default.nix b/hosts/Alaska/default.nix index c2f48e6..b00e4d1 100644 --- a/hosts/Alaska/default.nix +++ b/hosts/Alaska/default.nix @@ -7,6 +7,7 @@ (import ./hardware-configuration.nix) (import ./modules/nginx.nix) (import ./modules/nextcloud.nix) + (import ./modules/postgresql.nix) (import ./modules/msmtp.nix) (import ./modules/forgejo.nix) ]; diff --git a/hosts/Alaska/modules/postgresql.nix b/hosts/Alaska/modules/postgresql.nix new file mode 100644 index 0000000..5ff13d7 --- /dev/null +++ b/hosts/Alaska/modules/postgresql.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: + +{ + + services.postgresql = { + enable = true; + ensureDatabases = [ "nextcloud" ]; + ensureUsers = [ + { + name = "nextcloud"; + ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES"; + } + ]; + authentication = lib.mkForce '' + # TYPE DATABASE USER ADDRESS METHOD + local all all trust + host all all 127.0.0.1/32 trust + host all all ::1/128 trust + ''; + }; + +}