]> Git — Sourcephile - sourcephile-nix.git/blob - machines/losurdo/freeciv.nix
nixpkgs: bump to latest version
[sourcephile-nix.git] / machines / 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 postRun = "systemctl reload freeciv";
15 };
16 systemd.services.postgresql = {
17 wants = [ "acme-selfsigned-${domain}.service" "acme-${domain}.service"];
18 after = [ "acme-selfsigned-${domain}.service" ];
19 };
20 services.upnpc.redirections = [
21 { description = "";
22 externalPort = freeciv.settings.port; protocol = "TCP";
23 service.wantedBy = ["freeciv.service"];
24 service.partOf = ["freeciv.service"];
25 }
26 ];
27 services.freeciv = {
28 enable = true;
29 settings = {
30 Announce = "none";
31 Guests = true;
32 Newusers = true;
33 auth = true;
34 debug = 3;
35 };
36 };
37 }