178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 *
This commit is contained in:
@@ -57,20 +57,14 @@ in
|
|||||||
# enable the ${service} service
|
# enable the ${service} service
|
||||||
services.${service} = {
|
services.${service} = {
|
||||||
enable = true;
|
enable = true;
|
||||||
listeners = [{
|
listeners = [
|
||||||
port = cfg.port;
|
{
|
||||||
settings = {
|
acl = [ "pattern readwrite #" ]; # Allows read/write access to all topics
|
||||||
allow_anonymous = false;
|
omitPasswordAuth = true; # Disables password authentication
|
||||||
listener = 1883;
|
settings.allow_anonymous = true; # Allows anonymous connections
|
||||||
listener = 9001;
|
}
|
||||||
protocol = websockets;
|
];
|
||||||
persistence = true;
|
|
||||||
password_file = ${sec."mosquitto_password_file".path};
|
|
||||||
persistence_file = ${service}.db;
|
|
||||||
persistence_location = cfg.data_dir;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# override umask to make permissions work out
|
# override umask to make permissions work out
|
||||||
@@ -81,23 +75,23 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
# # open firewall
|
# # open firewall
|
||||||
# networking.firewall.allowedTCPPorts = [ cfg.port ];
|
networking.firewall.allowedTCPPorts = [ cfg.port ];
|
||||||
|
|
||||||
# internal reverse proxy entry
|
# # internal reverse proxy entry
|
||||||
services.nginx.virtualHosts."${cfg.url}" = {
|
# services.nginx.virtualHosts."${cfg.url}" = {
|
||||||
forceSSL = true;
|
# forceSSL = true;
|
||||||
sslCertificate = sec."ssl_blakedheld_crt".path;
|
# sslCertificate = sec."ssl_blakedheld_crt".path;
|
||||||
sslCertificateKey = sec."ssl_blakedheld_key".path;
|
# sslCertificateKey = sec."ssl_blakedheld_key".path;
|
||||||
locations."/" = {
|
# locations."/" = {
|
||||||
proxyPass = "http://127.0.0.1:${toString cfg.port}";
|
# proxyPass = "http://127.0.0.1:${toString cfg.port}";
|
||||||
};
|
# };
|
||||||
};
|
# };
|
||||||
|
|
||||||
sops.secrets = {
|
# sops.secrets = {
|
||||||
"${service}_password_file" = {
|
# "${service}_password_file" = {
|
||||||
owner = "${service}";
|
# owner = "${service}";
|
||||||
group = "${service}";
|
# group = "${service}";
|
||||||
};
|
# };
|
||||||
|
|
||||||
# add to backups
|
# add to backups
|
||||||
modules.system.backups.paths = lib.mkIf cfg.backup [ cfg.data_dir ];
|
modules.system.backups.paths = lib.mkIf cfg.backup [ cfg.data_dir ];
|
||||||
|
|||||||
Reference in New Issue
Block a user