about summary refs log tree commit diff
path: root/ops/nixos
diff options
context:
space:
mode:
Diffstat (limited to 'ops/nixos')
-rw-r--r--ops/nixos/whitby/default.nix20
1 files changed, 18 insertions, 2 deletions
diff --git a/ops/nixos/whitby/default.nix b/ops/nixos/whitby/default.nix
index e3f33350c496..2229b44dd79d 100644
--- a/ops/nixos/whitby/default.nix
+++ b/ops/nixos/whitby/default.nix
@@ -12,7 +12,7 @@ let
     mkdir -p $out/bin
     ln -s ${depot.ops.besadii}/bin/besadii $out/bin/post-command
   '';
-in {
+in lib.fix(self: {
   inherit depot;
   imports = [
     "${depot.depotPath}/ops/nixos/clbot.nix"
@@ -106,9 +106,16 @@ in {
     # Glass is boring, but Luke doesn't like Wapping - the Prospect of
     # Whitby, however, is quite a pleasant establishment.
     hostName = "whitby";
+    domain = "tvl.fyi";
     hostId = "b38ca543";
     useDHCP = false;
 
+    # Don't use Hetzner's DNS servers.
+    nameservers = [
+      "8.8.8.8"
+      "8.8.4.4"
+    ];
+
     defaultGateway6 = {
       address = "fe80::1";
       interface = "enp196s0";
@@ -125,6 +132,15 @@ in {
     ];
   };
 
+  # Generate an immutable /etc/resolv.conf from the nameserver settings
+  # above (otherwise DHCP overwrites it):
+  environment.etc."resolv.conf" = with lib; {
+    source = depot.third_party.writeText "resolv.conf" ''
+      ${concatStringsSep "\n" (map (ns: "nameserver ${ns}") self.networking.nameservers)}
+      options edns0
+    '';
+  };
+
   time.timeZone = "UTC";
 
   nix = {
@@ -298,4 +314,4 @@ in {
   };
 
   system.stateVersion = "20.03";
-}
+})