1 { config, lib, pkgs, ... }:
6 cfg = config.services.nixops-dns;
11 services.nixops-dns = {
15 description = lib.mdDoc ''
16 Whether to enable the nixops-dns resolution
17 of NixOps virtual machines via dnsmasq and fake domain name.
23 description = lib.mdDoc ''
24 The user the nixops-dns daemon should run as.
25 This should be the user, which is also used for nixops and
26 have the .nixops directory in its home.
32 description = lib.mdDoc ''
33 Fake domain name to resolve to NixOps virtual machines.
35 For example "ops" will resolve "vm.ops".
43 description = lib.mdDoc ''
44 Enable dnsmasq forwarding to nixops-dns. This allows to use
45 nixops-dns for `services.nixops-dns.domain` resolution
46 while forwarding the rest of the queries to original resolvers.
53 config = mkIf cfg.enable {
54 systemd.services.nixops-dns = {
55 description = "nixops-dns: DNS server for resolving NixOps machines";
56 wantedBy = [ "multi-user.target" ];
61 ExecStart="${pkg}/bin/nixops-dns --domain=.${cfg.domain}";
65 services.dnsmasq = mkIf cfg.dnsmasq {
67 resolveLocalQueries = true;
69 "/${cfg.domain}/127.0.0.1#5300"
73 listen-address=127.0.0.1