convert firewall service to new serviceDefn

this is a bit kludgey with dependencies, need to
come back and look at that
This commit is contained in:
Daniel Barlow
2023-08-05 12:07:35 +01:00
parent fbb2c04132
commit 90c1d59aca
3 changed files with 16 additions and 15 deletions

View File

@@ -4,20 +4,11 @@
, firewallgen
, nftables
}:
{ ruleset }:
let
inherit (liminix.services) oneshot;
inherit (liminix.lib) typeChecked;
inherit (lib) mkOption types;
t = {
ruleset = mkOption {
type = types.anything; # we could usefully define this more tightly
description = "firewall ruleset";
};
};
in
params:
let
inherit (typeChecked "firewall" t params) ruleset;
script = firewallgen "firewall.nft" ruleset;
in oneshot {
name = "firewall";