mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-08 19:45:42 +03:00
nixos/mastodon: don't pin postgresql version for test
This commit is contained in:
parent
abcef4da4e
commit
14fbed4b70
2 changed files with 17 additions and 20 deletions
|
@ -10,6 +10,9 @@ let
|
||||||
192.168.2.103 mastodon.local
|
192.168.2.103 mastodon.local
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
postgresqlPassword = "thisisnotasecret";
|
||||||
|
redisPassword = "thisisnotasecrettoo";
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
name = "mastodon-remote-postgresql";
|
name = "mastodon-remote-postgresql";
|
||||||
|
@ -19,9 +22,7 @@ in
|
||||||
databases = { config, ... }: {
|
databases = { config, ... }: {
|
||||||
environment = {
|
environment = {
|
||||||
etc = {
|
etc = {
|
||||||
"redis/password-redis-db".text = ''
|
"redis/password-redis-db".text = redisPassword;
|
||||||
ogjhJL8ynrP7MazjYOF6
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
networking = {
|
networking = {
|
||||||
|
@ -46,16 +47,19 @@ in
|
||||||
|
|
||||||
services.postgresql = {
|
services.postgresql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# TODO remove once https://github.com/NixOS/nixpkgs/pull/266270 is resolved.
|
|
||||||
package = pkgs.postgresql_14;
|
|
||||||
enableTCPIP = true;
|
enableTCPIP = true;
|
||||||
authentication = ''
|
authentication = ''
|
||||||
hostnossl mastodon_local mastodon_test 192.168.2.201/32 md5
|
hostnossl mastodon mastodon 192.168.2.201/32 md5
|
||||||
'';
|
'';
|
||||||
|
ensureDatabases = [ "mastodon" ];
|
||||||
|
ensureUsers = [
|
||||||
|
{
|
||||||
|
name = "mastodon";
|
||||||
|
ensureDBOwnership = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
initialScript = pkgs.writeText "postgresql_init.sql" ''
|
initialScript = pkgs.writeText "postgresql_init.sql" ''
|
||||||
CREATE ROLE mastodon_test LOGIN PASSWORD 'SoDTZcISc3f1M1LJsRLT';
|
CREATE ROLE mastodon LOGIN PASSWORD '${postgresqlPassword}';
|
||||||
CREATE DATABASE mastodon_local TEMPLATE template0 ENCODING UTF8;
|
|
||||||
GRANT ALL PRIVILEGES ON DATABASE mastodon_local TO mastodon_test;
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -100,12 +104,8 @@ in
|
||||||
|
|
||||||
environment = {
|
environment = {
|
||||||
etc = {
|
etc = {
|
||||||
"mastodon/password-redis-db".text = ''
|
"mastodon/password-redis-db".text = redisPassword;
|
||||||
ogjhJL8ynrP7MazjYOF6
|
"mastodon/password-posgressql-db".text = postgresqlPassword;
|
||||||
'';
|
|
||||||
"mastodon/password-posgressql-db".text = ''
|
|
||||||
SoDTZcISc3f1M1LJsRLT
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -138,8 +138,8 @@ in
|
||||||
createLocally = false;
|
createLocally = false;
|
||||||
host = "192.168.2.102";
|
host = "192.168.2.102";
|
||||||
port = 5432;
|
port = 5432;
|
||||||
name = "mastodon_local";
|
name = "mastodon";
|
||||||
user = "mastodon_test";
|
user = "mastodon";
|
||||||
passwordFile = "/etc/mastodon/password-posgressql-db";
|
passwordFile = "/etc/mastodon/password-posgressql-db";
|
||||||
};
|
};
|
||||||
smtp = {
|
smtp = {
|
||||||
|
|
|
@ -34,9 +34,6 @@ in
|
||||||
pki.certificateFiles = [ "${cert pkgs}/cert.pem" ];
|
pki.certificateFiles = [ "${cert pkgs}/cert.pem" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO remove once https://github.com/NixOS/nixpkgs/pull/266270 is resolved.
|
|
||||||
services.postgresql.package = pkgs.postgresql_14;
|
|
||||||
|
|
||||||
services.mastodon = {
|
services.mastodon = {
|
||||||
enable = true;
|
enable = true;
|
||||||
configureNginx = true;
|
configureNginx = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue