main
 1{den, ...}: {
 2  den.quirks.dhcpReservation.description = ''
 3    DHCP reservations self-declared by hosts, collected fleet-wide.
 4
 5    Example:
 6      {
 7        mac = "00:11:22:33:44:55"; # MAC address to reserve
 8        ip = "192.168.52.10";      # Fixed IP to assign
 9      }
10  '';
11
12  den.policies.collect-dhcp-reservations = _: let
13    inherit (den.lib.policy) pipe;
14  in [
15    (pipe.from "dhcpReservation" [
16      (pipe.collectAll ({host, ...}: true))
17      pipe.withProvenance
18    ])
19  ];
20
21  den.schema.host.includes = [den.policies.collect-dhcp-reservations];
22}