10 pkg = pkgs.nixops-dns;
11 cfg = config.services.nixops-dns;
16 services.nixops-dns = {
21 Whether to enable the nixops-dns resolution
22 of NixOps virtual machines via dnsmasq and fake domain name.
29 The user the nixops-dns daemon should run as.
30 This should be the user, which is also used for nixops and
31 have the .nixops directory in its home.
38 Fake domain name to resolve to NixOps virtual machines.
40 For example "ops" will resolve "vm.ops".
49 Enable dnsmasq forwarding to nixops-dns. This allows to use
50 nixops-dns for `services.nixops-dns.domain` resolution
51 while forwarding the rest of the queries to original resolvers.
58 config = mkIf cfg.enable {
59 systemd.services.nixops-dns = {
60 description = "nixops-dns: DNS server for resolving NixOps machines";
61 wantedBy = [ "multi-user.target" ];
66 ExecStart = "${pkg}/bin/nixops-dns --domain=.${cfg.domain}";
70 services.dnsmasq = mkIf cfg.dnsmasq {
72 resolveLocalQueries = true;
74 "/${cfg.domain}/127.0.0.1#5300"
77 bind-interfaces = true;
78 listen-address = "127.0.0.1";