liminix/modules/firewall/service.nix
Daniel Barlow 90c1d59aca convert firewall service to new serviceDefn
this is a bit kludgey with dependencies, need to
come back and look at that
2023-08-05 12:07:35 +01:00

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