Minor changes
This commit is contained in:
parent
eeea25a648
commit
f64c331603
|
@ -52,8 +52,7 @@ let
|
|||
ln -s ${base-data-path}/${site} $out/data
|
||||
ln -s ${site-cfg.favicon} $out/favicon.ico
|
||||
'';
|
||||
}))
|
||||
cfg.sites;
|
||||
})) cfg.sites;
|
||||
|
||||
siteOpts = { site-host, ... }: {
|
||||
options = {
|
||||
|
@ -111,13 +110,13 @@ let
|
|||
};
|
||||
|
||||
edit-mode = mkOption {
|
||||
type = types.enum ["Plain" "Html" "PlainForced" "HtmlForced"];
|
||||
type = types.enum [ "Plain" "Html" "PlainForced" "HtmlForced" ];
|
||||
description = "Default text editing mode for email";
|
||||
default = "Html";
|
||||
};
|
||||
|
||||
layout-mode = mkOption {
|
||||
type = types.enum ["side" "bottom"];
|
||||
type = types.enum [ "side" "bottom" ];
|
||||
description = "Layout mode to use for email preview.";
|
||||
default = "side";
|
||||
};
|
||||
|
@ -157,7 +156,7 @@ let
|
|||
databaseOpts = { ... }: {
|
||||
options = {
|
||||
type = mkOption {
|
||||
type = types.enum ["pgsql" "mysql"];
|
||||
type = types.enum [ "pgsql" "mysql" ];
|
||||
description = "Driver to use when connecting to the database.";
|
||||
default = "pgsql";
|
||||
};
|
||||
|
@ -176,7 +175,8 @@ let
|
|||
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
description = "Name of the database containing contact info. <user> must have access.";
|
||||
description =
|
||||
"Name of the database containing contact info. <user> must have access.";
|
||||
default = "rainloop_contacts";
|
||||
};
|
||||
|
||||
|
@ -226,13 +226,13 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
security.acme.certs = mapAttrs' (site: site-cfg:
|
||||
nameValuePair site {
|
||||
email = site-cfg.admin-email;
|
||||
}) cfg.sites;
|
||||
security.acme.certs = mapAttrs'
|
||||
(site: site-cfg: nameValuePair site { email = site-cfg.admin-email; })
|
||||
cfg.sites;
|
||||
|
||||
services = {
|
||||
phpfpm = {
|
||||
|
||||
pools.webmail = {
|
||||
settings = {
|
||||
"pm" = "dynamic";
|
||||
|
@ -242,6 +242,10 @@ in {
|
|||
"pm.max_spare_servers" = 8;
|
||||
};
|
||||
|
||||
phpOptions = ''
|
||||
memory_limit = 500M
|
||||
'';
|
||||
|
||||
# Not working....see chmod below
|
||||
user = webmail-user;
|
||||
group = webmail-group;
|
||||
|
@ -258,9 +262,7 @@ in {
|
|||
root = "${site-packages.${site}}";
|
||||
|
||||
locations = {
|
||||
"/" = {
|
||||
index = "index.php";
|
||||
};
|
||||
"/" = { index = "index.php"; };
|
||||
|
||||
"/data" = {
|
||||
extraConfig = ''
|
||||
|
@ -279,16 +281,18 @@ in {
|
|||
fastcgi_pass unix:${config.services.phpfpm.pools.webmail.socket};
|
||||
}
|
||||
'';
|
||||
})
|
||||
cfg.sites;
|
||||
}) cfg.sites;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services = {
|
||||
webmail-init = let
|
||||
link-configs = concatStringsSep "\n" (mapAttrsToList (site: site-cfg: let
|
||||
cfg-file = builtins.toFile "${site}-rainloop.cfg" (import ./include/rainloop.nix lib site site-cfg site-packages.${site}.version);
|
||||
domain-cfg = builtins.toFile "${site}-domain.cfg" ''
|
||||
link-configs = concatStringsSep "\n" (mapAttrsToList (site: site-cfg:
|
||||
let
|
||||
cfg-file = builtins.toFile "${site}-rainloop.cfg"
|
||||
(import ./include/rainloop.nix lib site site-cfg
|
||||
site-packages.${site}.version);
|
||||
domain-cfg = builtins.toFile "${site}-domain.cfg" ''
|
||||
imap_host = "${site-cfg.mail-server}"
|
||||
imap_port = 143
|
||||
imap_secure = "TLS"
|
||||
|
@ -306,7 +310,7 @@ in {
|
|||
smtp_php_mail = Off
|
||||
white_list = ""
|
||||
'';
|
||||
in ''
|
||||
in ''
|
||||
${pkgs.coreutils}/bin/mkdir -p ${base-data-path}/${site}/_data_/_default_/configs
|
||||
${pkgs.coreutils}/bin/cp ${cfg-file} ${base-data-path}/${site}/_data_/_default_/configs/application.ini
|
||||
|
||||
|
@ -314,20 +318,22 @@ in {
|
|||
${pkgs.coreutils}/bin/cp ${domain-cfg} ${base-data-path}/${site}/_data_/_default_/domains/${site-cfg.domain}.ini
|
||||
'') cfg.sites);
|
||||
scriptPkg = (pkgs.writeScriptBin "webmail-init.sh" ''
|
||||
#!${pkgs.bash}/bin/bash -e
|
||||
${link-configs}
|
||||
${pkgs.coreutils}/bin/chown -R ${webmail-user}:${webmail-group} ${base-data-path}
|
||||
${pkgs.coreutils}/bin/chmod -R ug+w ${base-data-path}
|
||||
'');
|
||||
#!${pkgs.bash}/bin/bash -e
|
||||
${link-configs}
|
||||
${pkgs.coreutils}/bin/chown -R ${webmail-user}:${webmail-group} ${base-data-path}
|
||||
${pkgs.coreutils}/bin/chmod -R ug+w ${base-data-path}
|
||||
'');
|
||||
in {
|
||||
requiredBy = [ "nginx.service" ];
|
||||
description = "Initialize webmail service directories prior to starting nginx.";
|
||||
description =
|
||||
"Initialize webmail service directories prior to starting nginx.";
|
||||
script = "${scriptPkg}/bin/webmail-init.sh";
|
||||
};
|
||||
|
||||
phpfpm-webmail-socket-perm = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
description = "Change ownership of the phpfpm socket for webmail once it's started.";
|
||||
description =
|
||||
"Change ownership of the phpfpm socket for webmail once it's started.";
|
||||
requires = [ "phpfpm-webmail.service" ];
|
||||
after = [ "phpfpm.target" ];
|
||||
serviceConfig = {
|
||||
|
@ -338,10 +344,8 @@ in {
|
|||
};
|
||||
|
||||
nginx = {
|
||||
requires = [
|
||||
"webmail-init.service"
|
||||
"phpfpm-webmail-socket-perm.service"
|
||||
];
|
||||
requires =
|
||||
[ "webmail-init.service" "phpfpm-webmail-socket-perm.service" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -583,7 +583,7 @@ in {
|
|||
|
||||
fudo.minecraft-server = {
|
||||
enable = true;
|
||||
package = pkgs.minecraft-server_1_16_2;
|
||||
package = pkgs.minecraft-server_1_16_4;
|
||||
data-dir = minecraft-data-dir;
|
||||
world-name = "selbyland";
|
||||
motd = "Welcome to the Selby Minecraft server.";
|
||||
|
|
|
@ -17,21 +17,21 @@ in {
|
|||
};
|
||||
|
||||
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 = {
|
||||
# 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";
|
||||
|
@ -41,14 +41,14 @@ in {
|
|||
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" ];
|
||||
};
|
||||
# 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 = {
|
||||
|
|
|
@ -10,6 +10,17 @@ in {
|
|||
fetchurl = builtins.fetchurl;
|
||||
};
|
||||
|
||||
minecraft-server_1_16_4 = pkgs.minecraft-server.overrideAttrs
|
||||
(oldAttrs: rec {
|
||||
version = "1.15.1";
|
||||
src = builtins.fetchurl {
|
||||
url =
|
||||
"https://launcher.mojang.com/v1/objects/35139deedbd5182953cf1caa23835da59ca3d7cd/server.jar";
|
||||
sha256 =
|
||||
"01i5nd03sbnffbyni1fa6hsg5yll2h19vfrpcydlivx10gck0ka4";
|
||||
};
|
||||
});
|
||||
|
||||
minecraft-server_1_15_1 = pkgs.minecraft-server.overrideAttrs
|
||||
(oldAttrs: rec {
|
||||
version = "1.15.1";
|
||||
|
|
Loading…
Reference in New Issue