migrate sites to central db

This commit is contained in:
TheWanderingCrow 2026-03-22 10:32:15 -04:00
parent 09fac5ab72
commit 5322e95d73
4 changed files with 39 additions and 26 deletions

View file

@ -0,0 +1,10 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
mycli
];
services.mysql = {
enable = true;
package = pkgs.mariadb_118;
};
}

View file

@ -17,6 +17,7 @@
# FIXME(TODO): Turn this into it's own backup module
./backup.nix
./database.nix
# Disks
inputs.disko.nixosModules.disko

View file

@ -59,13 +59,13 @@ in
];
# TODO: Need to actually store secrets in a safe manner here when we cutover
};
flamebandsite.containerConfig = {
image = "wordpress";
publishPorts = [
"${builtins.toString bandPort}:80"
];
# TODO: Need to actually store secrets in a safe manner here when we cutover
};
# flamebandsite.containerConfig = {
# image = "wordpress";
# publishPorts = [
# "${builtins.toString bandPort}:80"
# ];
# # TODO: Need to actually store secrets in a safe manner here when we cutover
# };
};
};
}

View file

@ -1,10 +1,12 @@
{
pkgs,
inputs,
lib,
...
}:
let
volumePath = "/overseer/services";
maintFile = lib.custom.relativeToRoot "assets/maint.html";
in
{
systemd.tmpfiles.rules = [
@ -13,26 +15,26 @@ in
"d ${volumePath}/flamesites/nnsbluegrass 0750 crow"
];
systemd.timers.flamesite-backup = {
enable = true;
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "1hr";
OnUnitActiveSec = "1hr";
Unit = "flamesite-backup.service";
};
};
# systemd.timers.flamesite-backup = {
# enable = false;
# wantedBy = [ "timers.target" ];
# timerConfig = {
# OnBootSec = "1hr";
# OnUnitActiveSec = "1hr";
# Unit = "flamesite-backup.service";
# };
# };
systemd.services.flamesite-backup = {
script = ''
${pkgs.podman}/bin/podman exec swgal_db_1 sh -c 'exec mysqldump --no-tablespaces -usgr_user -psgr_pass sgr_db' > ${volumePath}/flamesites/swgalaxyproject/db.sql
${pkgs.podman}/bin/podman exec nnsbluegrass_db_1 sh -c 'exec mysqldump --no-tablespaces -unns_user -pnns_pass nns_db' > ${volumePath}/flamesites/nnsbluegrass/db.sql
'';
serviceConfig = {
Type = "oneshot";
User = "crow";
};
};
# systemd.services.flamesite-backup = {
# # ${pkgs.podman}/bin/podman exec swgal_db_1 sh -c 'exec mysqldump --no-tablespaces -usgr_user -psgr_pass sgr_db' > ${volumePath}/flamesites/swgalaxyproject/db.sql
# # ${pkgs.podman}/bin/podman exec nnsbluegrass_db_1 sh -c 'exec mysqldump --no-tablespaces -unns_user -pnns_pass nns_db' > ${volumePath}/flamesites/nnsbluegrass/db.sql
# script = ''
# '';
# serviceConfig = {
# Type = "oneshot";
# User = "crow";
# };
# };
services.caddy = {
enable = true;