dev.fron.io nixrc / 9f0d6d9
hosts(zeta): ensure ipv6 Tony Olagbaiye 18 days ago
4 changed file(s) with 21 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
5454 modules.legacyauth = true;
5555 modules.websocket = true;
5656 muc = [{
57 domain = "muc.xa0.uk";
57 domain = "muc.${usr.secrets.domains.srvc}";
5858 maxHistoryMessages = 10000;
5959 name = "Zeta Prosody";
6060 }];
6363 key = "/var/lib/acme/${usr.secrets.domains.srvc}/key.pem";
6464 };
6565 uploadHttp = {
66 domain = "xmpp.xa0.uk";
66 domain = "xmpp.${usr.secrets.domains.srvc}";
6767 };
6868 #disco_items = [{
69 # url = "xmpp.xa0.uk";
69 # url = "xmpp.${usr.secrets.domains.srvc}";
7070 #}];
7171 virtualHosts.srvc = {
7272 enabled = true;
73 domain = "xa0.uk";
73 domain = usr.secrets.domains.srvc;
7474 };
7575 };
7676
134134 media_player = [{
135135 platform = "androidtv";
136136 name = "Omega";
137 host = "192.168.178.128";
137 host = usr.secrets.hosts.lan.omega;
138138 adb_server_ip = "127.0.0.1";
139139 apps = {
140140 "com.google.android.leanbacklauncher" = "Home Screen";
147147 notify = [{
148148 platform = "nfandroidtv";
149149 name = "AndroidTV";
150 host = "192.168.178.128";
150 host = usr.secrets.hosts.lan.omega;
151151 }];
152152 tuya = usr.secrets.hass.tuya;
153153 zeroconf = {};
209209 };
210210 };
211211
212 systemd.services.restart-sshd = {
212 systemd.services.ensure-ipv6 = {
213213 serviceConfig = {
214214 Type = "oneshot";
215 ExecStart = "systemctl restart sshd.service";
216 };
217 };
218 systemd.timers.restart-sshd = {
215 };
216 script = ''
217 set -euo pipefail
218 ping -6 -c1 2620:fe::fe || systemctl restart dhclient.service
219 '';
220 };
221 systemd.timers.ensure-ipv6 = {
219222 timerConfig = {
220223 OnStartupSec = "1h";
221224 OnUnitActiveSec = "1h";
66 type = with lib.types; nullOr str;
77 default = null;
88 };
9 config = lib.mkIf (cfg.restartPeriod != null) {
9 config = {
1010 # Bit meta but helps ensure sshd is bound to all addresses always
11 # TODO: move to profile
12 systemd.services.restart-openssh.script = if cfg.startWhenNeeded
13 then "${pkgs.systemd}/bin/systemctl restart sshd.socket"
14 else "${pkgs.systemd}/bin/systemctl restart sshd.service";
15 systemd.timers.restart-openssh = {
11 systemd.services.restart-openssh.serviceConfig.Type = "oneshot";
12 systemd.services.restart-openssh.serviceConfig.ExecStart = if cfg.startWhenNeeded
13 then "systemctl restart sshd.socket"
14 else "systemctl restart sshd.service";
15 systemd.timers.restart-openssh = lib.mkIf (cfg.restartPeriod != null) {
1616 timerConfig = {
1717 OnCalendar = cfg.restartPeriod;
1818 Unit = "restart-openssh.service";
1919 };
20 wantedBy = [ "timers.target" ];
2021 };
2122 };
2223 }