]> Git — Sourcephile - sourcephile-nix.git/blob - hosts/losurdo/freeciv.nix
nix: update input secrets
[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 table inet filter {
10 chain input-net {
11 tcp dport ${toString freeciv.settings.port} counter accept comment "Freeciv"
12 }
13 }
14 '';
15 users.users.freeciv.isSystemUser = true;
16 users.groups.acme.members = [ users."freeciv".name ];
17 security.acme.certs."${domain}" = {
18 # Not supported
19 #postRun = "systemctl reload freeciv";
20 };
21 systemd.services.freeciv = {
22 wants = [ "acme-selfsigned-${domain}.service" "acme-${domain}.service"];
23 after = [ "acme-selfsigned-${domain}.service" ];
24 };
25 services.upnpc.redirections = [
26 { description = "";
27 externalPort = freeciv.settings.port; protocol = "TCP";
28 service.wantedBy = ["freeciv.service"];
29 service.partOf = ["freeciv.service"];
30 }
31 ];
32 services.freeciv = {
33 enable = true;
34 settings = {
35 Announce = "none";
36 Guests = true;
37 Newusers = true;
38 auth = true;
39 debug = 3;
40 };
41 };
42 }