[nix] Modularized the container backend so I can easily switch it with an option
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
inherit (import ./lib.nix config) mkContainer mkPostgresContainer terakoda;
|
||||
in {
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
(mkPostgresContainer {
|
||||
name = "focalboard";
|
||||
@@ -14,21 +15,26 @@ in {
|
||||
|
||||
sops.secrets = {
|
||||
"focalboard/database" = {
|
||||
restartUnits = [ "podman-focalboard.service" "podman-focalboard-postgres.service" ];
|
||||
restartUnits = [
|
||||
"${config.local.container-backend}-focalboard.service"
|
||||
"${config.local.container-backend}-focalboard-postgres.service"
|
||||
];
|
||||
mode = "0400";
|
||||
owner = config.users.users.focalboard.name;
|
||||
};
|
||||
};
|
||||
|
||||
sops.templates."focalboard-config.json" = {
|
||||
restartUnits = [ "podman-focalboard.service" ];
|
||||
restartUnits = [ "${config.local.container-backend}-focalboard.service" ];
|
||||
owner = config.users.users.focalboard.name;
|
||||
content = builtins.toJSON {
|
||||
# Defaults from https://github.com/mattermost-community/focalboard/blob/main/config.json
|
||||
"serverRoot" = "https://focalboard.terakoda.com";
|
||||
"port" = 8000;
|
||||
"dbtype" = "postgres";
|
||||
"dbconfig" = "postgres://focalboard:${config.sops.placeholder."focalboard/database"}@focalboard-postgres/focalboard?sslmode=disable&connect_timeout=10";
|
||||
"dbconfig" = "postgres://focalboard:${
|
||||
config.sops.placeholder."focalboard/database"
|
||||
}@focalboard-postgres/focalboard?sslmode=disable&connect_timeout=10";
|
||||
"useSSL" = true;
|
||||
"prometheus_address" = ":9092";
|
||||
"session_expire_time" = 2592000;
|
||||
|
||||
Reference in New Issue
Block a user