]> Git — Sourcephile - sourcephile-nix.git/blob - hosts/losurdo/freeciv.nix
mermet: fail2ban: add intranet on the ignoreIP
[sourcephile-nix.git] / hosts / losurdo / freeciv.nix
1 { pkgs, lib, config, ... }:
2 let
3 inherit (config.users) users;
4 domain = config.networking.domain;
5 inherit (config.services) freeciv;
6 in
7 {
8 networking.nftables.ruleset = ''
9 add rule inet filter net2fw tcp dport ${toString freeciv.settings.port} counter accept comment "Freeciv"
10 '';
11 users.users.freeciv.isSystemUser = true;
12 users.groups.acme.members = [ users."freeciv".name ];
13 security.acme.certs."${domain}" = {
14 # Not supported
15 #postRun = "systemctl reload freeciv";
16 };
17 systemd.services.freeciv = {
18 wants = [ "acme-selfsigned-${domain}.service" "acme-${domain}.service"];
19 after = [ "acme-selfsigned-${domain}.service" ];
20 };
21 services.upnpc.redirections = [
22 { description = "";
23 externalPort = freeciv.settings.port; protocol = "TCP";
24 service.wantedBy = ["freeciv.service"];
25 service.partOf = ["freeciv.service"];
26 }
27 ];
28 services.freeciv = {
29 enable = true;
30 settings = {
31 Announce = "none";
32 Guests = true;
33 Newusers = true;
34 auth = true;
35 debug = 3;
36 };
37 };
38 }