69 lines
2.1 KiB
Nix
69 lines
2.1 KiB
Nix
![]() |
{ 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 = {
|
||
|
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;
|
||
|
};
|
||
|
};
|
||
|
|
||
|
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"; };
|
||
|
};
|
||
|
|
||
|
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" ];
|
||
|
};
|
||
|
};
|
||
|
|
||
|
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 = "";
|
||
|
# };
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|