1 { config, lib, pkgs, ... }:
3 cfg = config.services.clatd;
5 settingsFormat = pkgs.formats.keyValue {};
7 configFile = settingsFormat.generate "clatd.conf" cfg.settings;
12 enable = lib.mkEnableOption "clatd";
14 package = lib.mkPackageOption pkgs "clatd" { };
16 settings = lib.mkOption {
17 type = lib.types.submodule ({ name, ... }: {
18 freeformType = settingsFormat.type;
21 example = lib.literalExpression ''
23 plat-prefix = "64:ff9b::/96";
27 Configuration of clatd. See [clatd Documentation](https://github.com/toreanderson/clatd/blob/master/README.pod#configuration).
33 config = lib.mkIf cfg.enable {
34 systemd.services.clatd = {
35 description = "464XLAT CLAT daemon";
36 documentation = [ "man:clatd(8)" ];
37 wantedBy = [ "multi-user.target" ];
38 after = [ "network-online.target" ];
39 wants = [ "network-online.target" ];
40 startLimitIntervalSec = 0;
43 ExecStart = "${cfg.package}/bin/clatd -c ${configFile}";
46 CapabilityBoundingSet = [
49 LockPersonality = true;
50 MemoryDenyWriteExecute = true;
51 NoNewPrivileges = true;
54 ProtectControlGroups = true;
56 ProtectHostname = true;
57 ProtectKernelLogs = true;
58 ProtectKernelModules = true;
59 ProtectProc = "invisible";
61 RestrictAddressFamilies = [
66 RestrictNamespaces = true;
67 RestrictRealtime = true;
68 RestrictSUIDSGID = true;
69 SystemCallArchitectures = "native";