blob: 7451477cdb5da29a7bcc41b8304048a0403035b0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
;;; SPDX-License-Identifier: GPL-3.0-or-later
;;; SPDX-FileCopyrightText: 2026 Marek Paśnikowski <marek@marekpasnikowski.pl>
;;; COPYRIGHT NOTICE
;;;
;;; Copyright 2026, Marek Paśnikowski <marek@marekpasnikowski.pl>
;;; LICENSE NOTICE
;;;
;;; This library is free software: you can redistribute it and/or modify it under the terms of
;;; the GNU General Public License as published by the Free Software Foundation,
;;; either version 3 of the License, or (at your option) any later version.
;;;
;;; This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
;;; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
;;; See the GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License along with this library.
;;; If not, see <https://www.gnu.org/licenses/>.
(define-module (deployment services databases)
#:use-module (gnu services)
#:use-module (gnu services databases)
#:use-module (guix gexp)
#:use-module ((gnu packages databases)
#:prefix gnu:packages:databases:)
#:export (matrix-postgresql-service))
(define postgres-hba
(mixed-text-file "pg_hba.conf"
"host synapse synapse_user 127.0.0.1/32 trust\n"
"host synapse synapse_user ::1/128 trust\n"
"local all all peer\n"
"host all all 127.0.0.1/32 md5\n"
"host all all ::1/128 md5\n"))
(define config-file
(postgresql-config-file
(log-destination "syslog")
(hba-file postgres-hba)
(ident-file (@@ (gnu services databases)
%default-postgres-ident))
(socket-directory "/var/run/postgresql")
(extra-config (list))))
(define matrix-postgresql-service-configuration
(postgresql-configuration
(postgresql gnu:packages:databases:postgresql-17)
(port 5432)
(locale "pl_PL.utf8")
(config-file config-file)
(log-directory "/var/log/postgresql")
(data-directory "/var/lib/postgresql/data")
(extension-packages (list))
(create-account? #t)
(home-directory "/var/lib/postgresql")
(allow-login? #t)
(uid 501)
(gid 501)))
(define matrix-postgresql-service
(service postgresql-service-type
matrix-postgresql-service-configuration))
|