4 inherit (config.users) users;
11 users.groups.${srv} = { };
13 systemd.services.${srv} = {
14 description = "${srv} service";
18 "/etc/ssl/certs/ca-certificates.crt"
22 #Environment = "RUST_LOG=matrirc=trace";
23 StateDirectory = [ "${srv}" "${srv}/media" ];
24 ExecStart = "${pkgs.matrirc}/bin/matrirc --ircd-listen 127.0.0.1:6667 --state-dir /var/lib/${srv} --media-dir /var/lib/${srv}/media"; # --allow-register --media-url https://gaia.codewreck.org/local/tmp/matrix
25 Restart = "on-failure";
26 NoNewPrivileges = true;
28 wantedBy = [ "default.target" ];
36 "127.0.0.1" = [ srv ];
38 networking.nftables.ruleset = ''
41 tcp dport 443 meta skuid ${users.matrirc.name} counter accept comment "${srv}"
45 services.sanoid.datasets."rpool/var/lib/${srv}" = {
46 use_template = [ "snap" ];
53 # TODO: timer to cleanup /var/lib/${srv}/media ?