nixos-config/config/service/forum_selby_ca.nix

39 lines
841 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let cfg = config.fudo.services.forum_selby_ca;
in {
options.fudo.services.forum_selby_ca = with types; {
enable = mkEnableOption "Enable the Selby forum on this host.";
state-directory = mkOption {
type = str;
description = "Path at which to store forum data.";
};
};
config = mkIf cfg.enable {
containers.forum_selby_ca = {
autoStart = true;
bindMounts = {
};
config = { config, pkgs, ... }: {
services.mysql = {
enable = true;
dataDir = "${cfg.state-directory}/mysql";
ensureUsers = [{
name = "forum_selby_ca";
ensurePermissions = { "forum_selby_ca.*" = "ALL PRIVILEGES"; };
}];
ensureDatabases = [ "forum_selby_ca" ];
};
};
};
};
}