liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

default.nix (1680B)


      1 ## DHCP6 client module
      2 ## ===================
      3 ##
      4 ##  This is for use if you have an IPv6-capable upstream that provides
      5 ##  address information and/or prefix delegation using DHCP6. It
      6 ##  provides a service to request address information in the form of a
      7 ##  DHCP lease, and two dependent services that listen for updates
      8 ##  to the DHCP address information and can be used to update
      9 ##  addresses of network interfaces that you want to assign those
     10 ##  prefixes to
     11 
     12 {
     13   lib,
     14   pkgs,
     15   config,
     16   ...
     17 }:
     18 let
     19   inherit (lib) mkOption types;
     20   inherit (pkgs) liminix;
     21 in
     22 {
     23   options = {
     24     system.service.dhcp6c = {
     25       client = mkOption { type = liminix.lib.types.serviceDefn; };
     26       prefix = mkOption { type = liminix.lib.types.serviceDefn; };
     27       address = mkOption { type = liminix.lib.types.serviceDefn; };
     28     };
     29   };
     30   config.system.service.dhcp6c = {
     31     client = config.system.callService ./client.nix {
     32       interface = mkOption {
     33         type = liminix.lib.types.interface;
     34         description = "interface (usually WAN) to query for DHCP6";
     35       };
     36     };
     37     address = config.system.callService ./address.nix {
     38       client = mkOption {
     39         type = types.anything; # liminix.lib.types.service;
     40       };
     41       interface = mkOption {
     42         type = liminix.lib.types.interface;
     43         description = "interface to assign the address to";
     44       };
     45     };
     46     prefix = config.system.callService ./prefix.nix {
     47       client = mkOption {
     48         type = types.anything; # liminix.lib.types.service;
     49       };
     50       interface = mkOption {
     51         type = liminix.lib.types.interface;
     52         description = "interface to assign <prefix>::1 to";
     53       };
     54     };
     55   };
     56 }