helix: make psql dbs from nix

This commit is contained in:
Anish Lakhwara 2023-05-30 22:23:05 +10:00
parent a6980a1b74
commit da8e4b25eb
3 changed files with 8 additions and 9 deletions

View file

@ -17,7 +17,6 @@
services.postgresql = { services.postgresql = {
enable = true; # Ensure postgresql is enabled enable = true; # Ensure postgresql is enabled
package = pkgs.postgresql_11;
authentication = '' authentication = ''
local freshrss all ident map=freshrss-users local freshrss all ident map=freshrss-users
''; '';
@ -26,8 +25,11 @@
freshrss-users freshrss freshrss freshrss-users freshrss freshrss
''; '';
ensureDatabases = [ "freshrss" ]; ensureDatabases = [ "freshrss" ];
ensureUsers = [
{ name = "freshrss"; ensurePermissions."DATABASE freshrss" = "ALL PRIVILEGES"; }
];
# TODO # TODO
# initialScript # set password for gitea user # initialScript # set password for freshrss user
}; };
services.nginx.virtualHosts."rss.sealight.xyz" = { services.nginx.virtualHosts."rss.sealight.xyz" = {

View file

@ -22,15 +22,14 @@
repository = { repository = {
DEFAULT_BRANCH = "main"; DEFAULT_BRANCH = "main";
}; };
# TODO
"markup.restructuredtext" = { "markup.restructuredtext" = {
ENABLED = true; ENABLED = true;
FILE_EXTENSIONS = ".rst"; FILE_EXTENSIONS = ".rst";
RENDER_COMMAND = "pandoc +RTS -M512M -RTS -f rst"; RENDER_COMMAND = "timeout 30s pandoc +RTS -RTS -f rst";
IS_INPUT_FILE = false; IS_INPUT_FILE = false;
}; };
mailer = { mailer = {
ENABLED = false; ENABLED = true;
MAILER_TYPE = "smtp"; MAILER_TYPE = "smtp";
FROM = "ops@sealight.xyz"; FROM = "ops@sealight.xyz";
SMTP_ADDR = "smtp.nullhex.com"; SMTP_ADDR = "smtp.nullhex.com";
@ -52,7 +51,7 @@
'' ''
gitea-users gitea gitea gitea-users gitea gitea
''; '';
# ensureDatabases = [ "gitea" ]; ensureDatabases = [ "gitea" ];
ensureUsers = [ ensureUsers = [
{ name = "gitea"; ensurePermissions."DATABASE gitea" = "ALL PRIVILEGES"; } { name = "gitea"; ensurePermissions."DATABASE gitea" = "ALL PRIVILEGES"; }
]; ];
@ -74,6 +73,4 @@
}; };
}; };
networking.firewall.allowedTCPPorts = [ 80 443 22 ]; networking.firewall.allowedTCPPorts = [ 80 443 22 ];
security.acme.defaults.email = "anish+acme@lakhwara.com";
security.acme.acceptTerms = true;
} }

View file

@ -52,7 +52,7 @@
"WOODPECKER_DATABASE_DATASOURCE=postgres:///woodpecker?host=/run/postgresql" "WOODPECKER_DATABASE_DATASOURCE=postgres:///woodpecker?host=/run/postgresql"
"WOODPECKER_DATABASE_DRIVER=postgres" "WOODPECKER_DATABASE_DRIVER=postgres"
"WOODPECKER_USER_CREATE=username:aynish,admin:true" # set your admin username "WOODPECKER_ADMIN=aynish"
]; ];
ExecStart = "${pkgs.woodpecker-server}/bin/woodpecker-server"; ExecStart = "${pkgs.woodpecker-server}/bin/woodpecker-server";
User = "woodpecker"; User = "woodpecker";