liminix

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

default.nix (1670B)


      1 ## Dnsmasq
      2 ## =======
      3 ##
      4 ## This module includes a service to provide DNS, DHCP, and IPv6
      5 ## router advertisement for the local network.
      6 
      7 
      8 { lib, pkgs, config, ...}:
      9 let
     10   inherit (lib) mkOption types;
     11   inherit (pkgs) liminix;
     12 in {
     13   options = {
     14     system.service.dnsmasq = mkOption {
     15       type = liminix.lib.types.serviceDefn;
     16     };
     17   };
     18   config = {
     19     system.service.dnsmasq = liminix.callService ./service.nix {
     20       user = mkOption {
     21         type = types.str;
     22         default = "dnsmasq";
     23       };
     24       group = mkOption {
     25         type = types.str;
     26         default = "dnsmasq";
     27       };
     28       resolvconf = mkOption {
     29         type = types.nullOr liminix.lib.types.service;
     30         default = null;
     31       };
     32       interface = mkOption {
     33         type = liminix.lib.types.service;
     34         default = null;
     35       };
     36       upstreams = mkOption {
     37         type = types.listOf types.str;
     38         default = [];
     39       };
     40       ranges = mkOption {
     41         type = types.listOf types.str;
     42       };
     43       domain = mkOption {
     44         # this can be given multiple times so probably should be
     45         # domains plural and list of string
     46         description = "Domain name for DHCP service: causes the DHCP server to return the domain to any hosts which request it, and sets the domain which it is legal for DHCP-configured hosts to claim";
     47         type = types.str;
     48         example = "example.com";
     49       };
     50     };
     51     users.dnsmasq = {
     52       uid = 51; gid= 51; gecos = "DNS/DHCP service user";
     53       dir = "/run/dnsmasq";
     54       shell = "/bin/false";
     55     };
     56     groups.dnsmasq = {
     57       gid = 51; usernames = ["dnsmasq"];
     58     };
     59     groups.system.usernames = ["dnsmasq"];
     60   };
     61 }