helm/hosts/profiles/ulogger-server/default.nix

64 lines
1.8 KiB
Nix
Raw Normal View History

2023-04-21 22:19:58 -07:00
{ self, pkgs, config, lib, ... }:
{
services.postgresql = {
2023-04-23 04:02:59 -07:00
enable = true;
2023-04-21 22:19:58 -07:00
ensureDatabases = [ "ulogger" ];
ensureUsers = [{
name = "ulogger";
ensurePermissions = {
"DATABASE ulogger" = "ALL PRIVILEGES";
};
}];
};
services.ulogger = {
enable = true;
hostName = "tracks.mossnet.lan";
2023-04-23 04:02:59 -07:00
user = "ulogger";
2023-04-21 22:19:58 -07:00
conf = ''
<?php
/* μlogger
*
* Copyright(C) 2017 Bartek Fabiszewski (www.fabiszewski.net)
*
* This 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 program 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 program; if not, see <http://www.gnu.org/licenses/>.
*/
// This is default configuration file.
// Copy it to config.php and customize
2023-04-23 04:02:59 -07:00
// Database config
2023-04-21 22:19:58 -07:00
2023-04-23 04:02:59 -07:00
// PDO data source name, eg.:
// mysql:host=localhost;port=3307;dbname=ulogger;charset=utf8
// mysql:unix_socket=/path/to/mysql.sock;dbname=ulogger;charset=utf8
// pgsql:host=localhost;port=5432;dbname=ulogger
// sqlite:/path/to/ulogger.db
$dbdsn = "pgsql:host=/run/postgresql/;port=5432;dbname=ulogger";
2023-04-21 22:19:58 -07:00
2023-04-23 04:02:59 -07:00
// Database user name
$dbuser = "ulogger";
2023-04-21 22:19:58 -07:00
2023-04-23 04:02:59 -07:00
// Database user password
$dbpass = "";
2023-04-21 22:19:58 -07:00
2023-04-23 04:02:59 -07:00
// Optional table names prefix, eg. "ulogger_"
$dbprefix = "";
2023-04-21 22:19:58 -07:00
?>
'';
};
}