gitea, crashes
This commit is contained in:
83
system-modules/postgres.nix
Normal file
83
system-modules/postgres.nix
Normal file
@@ -0,0 +1,83 @@
|
||||
{ config, pkgs, lib, user, ... }:
|
||||
{
|
||||
services = {
|
||||
postgresql = {
|
||||
enable = true;
|
||||
package = pkgs.postgresql_12;
|
||||
dataDir = "/var/lib/postgresql/${config.services.postgresql.package.psqlSchema}"; # default
|
||||
# identMap = ''
|
||||
# ${user} ${user} ${user}
|
||||
# '';
|
||||
enableJIT = false; # default
|
||||
initdbArgs = []; # default
|
||||
checkConfig = true; # default
|
||||
enableTCPIP = false;
|
||||
# # extraPlugins =
|
||||
initialScript = null; # default
|
||||
authentication = lib.mkForce ''
|
||||
# TYPE DATABASE USER ADDRESS METHOD
|
||||
local all all trust
|
||||
host all all 127.0.0.1/32 trust #scram-sha-256
|
||||
host all all ::1/128 trust #scram-sha-256
|
||||
'';
|
||||
# recoveryConfig = null;
|
||||
ensureDatabases = [
|
||||
"gitea"
|
||||
# "vaultwarden"
|
||||
];
|
||||
settings = {
|
||||
port = 5432; # default
|
||||
listen_addresses = "localhost";
|
||||
log_line_prefix = "[%p] "; # default
|
||||
shared_preload_libraries = [ ]; # default
|
||||
};
|
||||
ensureUsers = [
|
||||
# {
|
||||
# name = "${user}";
|
||||
# ensureDBOwnership = false;
|
||||
# ensureClauses = {
|
||||
# login = true;
|
||||
# # inherit
|
||||
# createdb = true;
|
||||
# bypassrls = true;
|
||||
# superuser = true;
|
||||
# createrole = true;
|
||||
# replication = true;
|
||||
# };
|
||||
# }
|
||||
{
|
||||
# as liong as there is no declarative user management you gotta set a pw by hand
|
||||
# sudo -u postgres psql -c "ALTER USER gitea PASSWORD 'new-passwd';"
|
||||
name = "gitea";
|
||||
ensureDBOwnership = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
# postgresqlBackup = {
|
||||
# enable
|
||||
# startAt
|
||||
# location
|
||||
# databases
|
||||
# backupAll
|
||||
# compression
|
||||
# }
|
||||
|
||||
|
||||
# postgresqlWalReceiver.receivers."main" = {
|
||||
# postgresqlPackage = pkgs.postgresql_15;
|
||||
# directory = /mnt/pg_wal/main/;
|
||||
# slot = "main_wal_receiver";
|
||||
# connection = "postgresql://user@somehost";
|
||||
# compress
|
||||
# extraArgs
|
||||
# synchronous
|
||||
# environment
|
||||
# statusInterval
|
||||
# };
|
||||
# }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user