liminix/modules/bridge/default.nix

38 lines
956 B
Nix
Raw Normal View History

{ lib, pkgs, config, ...}:
let
inherit (lib) mkOption types;
inherit (pkgs.liminix.services) oneshot;
2023-08-05 13:08:02 +00:00
inherit (pkgs) liminix;
in
{
options = {
system.service.bridge = {
primary = mkOption {
2023-08-05 13:08:02 +00:00
type = liminix.lib.types.serviceDefn;
};
members = mkOption {
2023-08-05 13:08:02 +00:00
type = liminix.lib.types.serviceDefn;
};
};
};
2023-08-05 13:08:02 +00:00
config.system.service.bridge = {
primary = liminix.callService ./primary.nix {
ifname = mkOption {
type = types.str;
description = "interface name for the bridge device";
};
};
members = liminix.callService ./members.nix {
members = mkOption {
type = types.listOf liminix.lib.types.service;
description = "interfaces to add to the bridge";
};
primary = mkOption {
type = liminix.lib.types.service;
description = "bridge interface to add them to";
};
};
};
2023-08-05 13:08:02 +00:00
config.kernel.config.BRIDGE = "y";
}