Configure pounce message saving
This commit is contained in:
parent
9e6bb34179
commit
446d479c7a
|
@ -1,23 +1,35 @@
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
let makeNetworkConfig = host: port: join: secret: {
|
let
|
||||||
content = ''
|
user = config.services.pounce.user;
|
||||||
sasl-plain = prescientmoon:${config.sops.placeholder.${secret}}
|
|
||||||
nick = prescientmoon
|
# Helper template for networks
|
||||||
host = ${host}
|
makeNetworkConfig = host: port: join: secret: {
|
||||||
port = ${toString port}
|
content = ''
|
||||||
join = ${join}
|
sasl-plain = prescientmoon:${config.sops.placeholder.${secret}}
|
||||||
'';
|
nick = prescientmoon
|
||||||
owner = config.services.pounce.user;
|
save = /persist/var/lib/pounce/${host}
|
||||||
};
|
host = ${host}
|
||||||
|
port = ${toString port}
|
||||||
|
join = ${join}
|
||||||
|
'';
|
||||||
|
owner = user;
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
# Create save directory for messages
|
||||||
|
systemd.tmpfiles.rules = [ "d /persist/state/var/lib/pounce 0755 ${user} ${user} -" ];
|
||||||
|
|
||||||
|
# Generate cert
|
||||||
security.acme.certs."wildcard-irc.moonythm.dev" = {
|
security.acme.certs."wildcard-irc.moonythm.dev" = {
|
||||||
group = config.services.pounce.user;
|
group = user;
|
||||||
domain = "*.irc.moonythm.dev";
|
domain = "*.irc.moonythm.dev";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Handle secrets using sops
|
||||||
sops.secrets.tilde_irc_pass.sopsFile = ../secrets.yaml;
|
sops.secrets.tilde_irc_pass.sopsFile = ../secrets.yaml;
|
||||||
sops.templates."pounce-tilde.cfg" = makeNetworkConfig "eu.tilde.chat" 6697 "#meta" "tilde_irc_pass";
|
sops.templates."pounce-tilde.cfg" = makeNetworkConfig "eu.tilde.chat" 6697 "#meta" "tilde_irc_pass";
|
||||||
|
|
||||||
|
# Configure pounce
|
||||||
services.pounce = {
|
services.pounce = {
|
||||||
enable = true;
|
enable = true;
|
||||||
externalHost = "irc.moonythm.dev";
|
externalHost = "irc.moonythm.dev";
|
||||||
|
|
Loading…
Reference in a new issue