Commit b45ba94a authored by Luke Granger-Brown's avatar Luke Granger-Brown Committed by Florian Klink
Browse files

nixos/tayga: add log option

This allows configuring logging in tayga, and enables it for the NixOS
test.
parent c204edcb
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -23,6 +23,10 @@ let
    data-dir ${cfg.dataDir}

    ${concatStringsSep "\n" (mapAttrsToList (ipv4: ipv6: "map " + ipv4 + " " + ipv6) cfg.mappings)}

    ${optionalString ((builtins.length cfg.log) > 0) ''
      log ${concatStringsSep " " cfg.log}
    ''}
  '';

  addrOpts =
@@ -132,6 +136,15 @@ in
          }
        '';
      };

      log = mkOption {
        type = types.listOf types.str;
        default = [ ];
        description = "Packet errors to log (drop, reject, icmp, self)";
        example = literalExpression ''
          [ "drop" "reject" "icmp" "self" ]
        '';
      };
    };
  };

+12 −0
Original line number Diff line number Diff line
@@ -139,6 +139,12 @@
        mappings = {
          "192.0.2.42" = "2001:db8::2";
        };
        log = [
          "drop"
          "reject"
          "icmp"
          "self"
        ];
      };
      environment.systemPackages = [ pkgs.tcpdump ];
    };
@@ -205,6 +211,12 @@
        mappings = {
          "192.0.2.42" = "2001:db8::2";
        };
        log = [
          "drop"
          "reject"
          "icmp"
          "self"
        ];
      };
      environment.systemPackages = [ pkgs.tcpdump ];
    };