liminix/modules/firewall/service.nix

18 lines
314 B
Nix
Raw Normal View History

{
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";
}