90c1d59aca
this is a bit kludgey with dependencies, need to come back and look at that
17 lines
314 B
Nix
17 lines
314 B
Nix
{
|
|
liminix
|
|
, lib
|
|
, firewallgen
|
|
, nftables
|
|
}:
|
|
{ ruleset }:
|
|
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";
|
|
}
|