about summary refs log tree commit diff
path: root/nixos/modules/services/misc/gitlab.nix
diff options
context:
space:
mode:
authorFranz Pletz <fpletz@fnordicwalking.de>2017-02-13 00:55:12 +0100
committerFranz Pletz <fpletz@fnordicwalking.de>2017-02-13 00:57:22 +0100
commitf5a82e4714371a65ed5ccc5ae46c5f106c953f83 (patch)
tree62f42a8c69d927bcc0a4521e033f8bea9f8fe126 /nixos/modules/services/misc/gitlab.nix
parent249506535166a3b60989b6fd70e7e6d3e5650d06 (diff)
downloadnixlib-f5a82e4714371a65ed5ccc5ae46c5f106c953f83.tar
nixlib-f5a82e4714371a65ed5ccc5ae46c5f106c953f83.tar.gz
nixlib-f5a82e4714371a65ed5ccc5ae46c5f106c953f83.tar.bz2
nixlib-f5a82e4714371a65ed5ccc5ae46c5f106c953f83.tar.lz
nixlib-f5a82e4714371a65ed5ccc5ae46c5f106c953f83.tar.xz
nixlib-f5a82e4714371a65ed5ccc5ae46c5f106c953f83.tar.zst
nixlib-f5a82e4714371a65ed5ccc5ae46c5f106c953f83.zip
gitlab service: fix database creation
Providing custom a username and database name was broken. They were
hardcoded to "gitlab".
Diffstat (limited to 'nixos/modules/services/misc/gitlab.nix')
-rw-r--r--nixos/modules/services/misc/gitlab.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/services/misc/gitlab.nix b/nixos/modules/services/misc/gitlab.nix
index 1fc3a5cc8691..36db4fb96606 100644
--- a/nixos/modules/services/misc/gitlab.nix
+++ b/nixos/modules/services/misc/gitlab.nix
@@ -528,8 +528,8 @@ in {
 
         if [ "${cfg.databaseHost}" = "127.0.0.1" ]; then
           if ! test -e "${cfg.statePath}/db-created"; then
-            psql postgres -c "CREATE ROLE gitlab WITH LOGIN NOCREATEDB NOCREATEROLE NOCREATEUSER ENCRYPTED PASSWORD '${cfg.databasePassword}'"
-            ${config.services.postgresql.package}/bin/createdb --owner gitlab gitlab || true
+            psql postgres -c "CREATE ROLE ${cfg.databaseUsername} WITH LOGIN NOCREATEDB NOCREATEROLE NOCREATEUSER ENCRYPTED PASSWORD '${cfg.databasePassword}'"
+            ${config.services.postgresql.package}/bin/createdb --owner ${cfg.databaseUsername} ${cfg.databaseName} || true
             touch "${cfg.statePath}/db-created"
           fi
         fi