2020-12-14 11:45:08 -06:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
hostname = "forum.test.selby.ca";
|
|
|
|
postgres-host = "france.fudo.org";
|
|
|
|
config-path = "/srv/selby-forum/conf";
|
|
|
|
redis-data-path = "/srv/selby-forum/redis-data";
|
|
|
|
sidekiq-data-path = "/srv/selby-forum/sidekiq-data";
|
|
|
|
discourse-data-path = "/srv/selby-forum/discourse-data";
|
|
|
|
|
|
|
|
in {
|
|
|
|
config = {
|
|
|
|
users.users = {
|
|
|
|
selby-discourse = { isSystemUser = true; };
|
|
|
|
selby-discourse-redis = { isSystemUser = true; };
|
|
|
|
selby-discourse-sidekiq = { isSystemUser = true; };
|
|
|
|
};
|
|
|
|
|
|
|
|
docker-containers = {
|
2021-01-06 12:51:40 -06:00
|
|
|
# selby-discourse = {
|
|
|
|
# image = "bitnami/discourse";
|
|
|
|
# ports = [ ];
|
|
|
|
# user = toString config.users.users.selby-discourse.uid;
|
|
|
|
# volumes = [
|
|
|
|
# "${config-path}:/opt/bitnami/discourse/mounted-conf"
|
|
|
|
# "${discourse-data-path}:/bitnami"
|
|
|
|
# ];
|
|
|
|
# extraDockerOptions = [ "--network=selby-discourse" ];
|
|
|
|
# environment = {
|
|
|
|
# DISCOURSE_SITENAME = "Selby Forum";
|
|
|
|
# DISCOURSE_EMAIL = "forum@selby.ca";
|
|
|
|
# DISCOURSE_HOSTNAME = hostname;
|
|
|
|
# };
|
|
|
|
# };
|
2020-12-14 11:45:08 -06:00
|
|
|
|
|
|
|
selby-discourse-redis = {
|
|
|
|
image = "bitnami/redis";
|
|
|
|
user = toString config.users.users.selby-discourse-redis.uid;
|
|
|
|
volumes = [ "${redis-data-path}:/bitnami" ];
|
|
|
|
extraDockerOptions = [ "--network=selby-discourse" ];
|
|
|
|
environment = { ALLOW_EMPTY_PASSWORD = "yes"; };
|
|
|
|
};
|
|
|
|
|
2021-01-06 12:51:40 -06:00
|
|
|
# selby-discourse-sidekiq = {
|
|
|
|
# image = "bitnami/discourse";
|
|
|
|
# user = toString config.users.users.selby-discourse-sidekiq.uid;
|
|
|
|
# volumes = [ "${sidekiq-data-path}:/bitnami" ];
|
|
|
|
# entrypoint = "nami";
|
|
|
|
# cmd = [ "start" "discourse-sidekiq" ];
|
|
|
|
# extraDockerOptions = [ "--network=selby-discourse" ];
|
|
|
|
# };
|
2020-12-14 11:45:08 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
systemd = {
|
|
|
|
services = {
|
|
|
|
# selby-discourse-config = {
|
|
|
|
# description = "Generate configuration for Selby discourse server.";
|
|
|
|
# requiredBy = [ "docker-selby-discourse.service" ];
|
|
|
|
# requires = [ "fudo-passwords.target" ];
|
|
|
|
# serviceConfig.Type = "oneshot";
|
|
|
|
# restartIfChanged = true;
|
|
|
|
|
|
|
|
# script = "";
|
|
|
|
# };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|