liminix

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

default.nix (1722B)


      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   imports = [
     24     ../ipv6-autoconfig
     25   ];
     26   options = {
     27     system.service.dhcp6c = {
     28       client = mkOption { type = liminix.lib.types.serviceDefn; };
     29       prefix = mkOption { type = liminix.lib.types.serviceDefn; };
     30       address = mkOption { type = liminix.lib.types.serviceDefn; };
     31     };
     32   };
     33   config.system.service.dhcp6c = {
     34     client = config.system.callService ./client.nix {
     35       interface = mkOption {
     36         type = liminix.lib.types.interface;
     37         description = "interface (usually WAN) to query for DHCP6";
     38       };
     39     };
     40     address = config.system.callService ./address.nix {
     41       client = mkOption {
     42         type = types.anything; # liminix.lib.types.service;
     43       };
     44       interface = mkOption {
     45         type = liminix.lib.types.interface;
     46         description = "interface to assign the address to";
     47       };
     48     };
     49     prefix = config.system.callService ./prefix.nix {
     50       client = mkOption {
     51         type = types.anything; # liminix.lib.types.service;
     52       };
     53       interface = mkOption {
     54         type = liminix.lib.types.interface;
     55         description = "interface to assign <prefix>::1 to";
     56       };
     57     };
     58   };
     59 }