2021-03-12 18:50:40 +01:00
|
|
|
{ lib }:
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
mkOption {
|
|
|
|
default = { };
|
|
|
|
type = with types;
|
|
|
|
attrsOf (submodule {
|
|
|
|
options = {
|
|
|
|
driver = mkOption { type = types.enum [ "ipxe" "virtio" ]; };
|
2021-03-15 16:07:05 +01:00
|
|
|
dump = mkEnableOption "packet logging";
|
2021-03-12 18:50:40 +01:00
|
|
|
platformPolicy = mkOption {
|
|
|
|
type = types.path;
|
|
|
|
default = builtins.toFile "driver.policy.dhall" ''
|
2021-03-28 15:07:21 +02:00
|
|
|
let Sigil = env:DHALL_SIGIL
|
2021-03-12 18:50:40 +01:00
|
|
|
|
|
|
|
in λ(driverName : Text) →
|
2021-03-28 15:07:21 +02:00
|
|
|
Sigil.Init.Config.Policy::{
|
2021-03-12 18:50:40 +01:00
|
|
|
, service = "Platform"
|
2021-03-28 15:07:21 +02:00
|
|
|
, label = Sigil.Init.LabelSelector.prefix driverName
|
2021-03-12 18:50:40 +01:00
|
|
|
, content =
|
2021-03-28 15:07:21 +02:00
|
|
|
[ Sigil.Prelude.XML.leaf
|
2021-03-12 18:50:40 +01:00
|
|
|
{ name = "pci", attributes = toMap { class = "ETHERNET" } }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
verbose = lib.mkEnableOption "verbose driver logging";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|