2023-07-16 17:55:50 +02:00
|
|
|
{
|
|
|
|
liminix
|
|
|
|
, lib
|
|
|
|
, firewallgen
|
|
|
|
, nftables
|
|
|
|
}:
|
2023-08-05 13:07:35 +02:00
|
|
|
{ ruleset }:
|
2023-07-16 17:55:50 +02:00
|
|
|
let
|
|
|
|
inherit (liminix.services) oneshot;
|
|
|
|
inherit (liminix.lib) typeChecked;
|
|
|
|
inherit (lib) mkOption types;
|
|
|
|
script = firewallgen "firewall.nft" ruleset;
|
|
|
|
in oneshot {
|
|
|
|
name = "firewall";
|
|
|
|
up = script;
|
|
|
|
down = "${nftables}/bin/nft flush ruleset";
|
|
|
|
}
|