nixos-config/machines/shinobu/services/router/nft.nix
Simon Bruder 362243f7f6
shinobu/router: Disable wg-upstream
This only complicates many things and creates too much overhead on such
a slow connection.
2023-09-26 15:38:02 +02:00

31 lines
629 B
Nix

{ config, lib, ... }:
let
cfg = import ./common.nix;
mkKeyValue = lib.generators.mkKeyValueDefault
rec {
mkValueString = v:
if lib.isString v then ''"${v}"''
else if lib.isList v then ''{ ${lib.concatMapStringsSep ", " mkValueString v} }''
else lib.generators.mkValueStringDefault { } v;
} " = ";
passthru = { };
defines = lib.concatStringsSep
"\n"
(lib.mapAttrsToList
(key: value: "define " + (mkKeyValue key value))
passthru);
in
{
networking.nftables = {
enable = true;
ruleset = ''
${defines}
include "${./rules.nft}"
'';
};
}