From b4a077814e75b4a599e995d95a519c4ef08a1e15 Mon Sep 17 00:00:00 2001
From: xinyangli <lixinyang411@gmail.com>
Date: Tue, 4 Mar 2025 18:32:55 +0800
Subject: [PATCH] calcite: test comin

---
 flake.nix                          | 19 ++++++++-----------
 garnix.yaml                        | 11 +----------
 home/xin/calcite.nix               |  1 +
 machines/calcite/configuration.nix |  2 +-
 machines/calcite/network.nix       | 30 ++++++++++++++++++++++++++----
 5 files changed, 37 insertions(+), 26 deletions(-)

diff --git a/flake.nix b/flake.nix
index abd9da6..f81f61a 100644
--- a/flake.nix
+++ b/flake.nix
@@ -123,6 +123,9 @@
         comin.nixosModules.comin
       ];
       nodeNixosModules = {
+        weilite = [
+          ./machines/weilite
+        ];
         calcite = [
           nixos-hardware.nixosModules.asus-zephyrus-ga401
           catppuccin.nixosModules.catppuccin
@@ -269,17 +272,6 @@
             ] ++ sharedColmenaModules;
           };
 
-        weilite =
-          { ... }:
-          {
-            imports = [ machines/weilite ] ++ sharedColmenaModules;
-            deployment = {
-              targetHost = "weilite.coho-tet.ts.net";
-              targetPort = 22;
-              buildOnTarget = false;
-            };
-            nixpkgs.system = "x86_64-linux";
-          };
         thorite =
           { ... }:
           {
@@ -309,6 +301,11 @@
         calcite = mkNixos {
           hostname = "calcite";
         };
+
+        weilite = mkNixos {
+          hostname = "weilite";
+        };
+
         baryte = mkNixos {
           hostname = "baryte";
         };
diff --git a/garnix.yaml b/garnix.yaml
index 630fac6..c9f5129 100644
--- a/garnix.yaml
+++ b/garnix.yaml
@@ -7,13 +7,4 @@ builds:
       - homeConfigurations.aarch64-linux.*
       - darwinConfigurations.*
       - nixosConfigurations.*
-    branch: deploy
-  - include:
-      - '*.x86_64-linux.*'
-      - defaultPackage.x86_64-linux
-      - devShell.x86_64-linux
-      - homeConfigurations.x86_64-linux.*
-      - homeConfigurations.aarch64-linux.*
-      - darwinConfigurations.*
-      - nixosConfigurations.*
-    branch: next
+    branch: testing-calcite
diff --git a/home/xin/calcite.nix b/home/xin/calcite.nix
index 40b93c9..8d83d35 100644
--- a/home/xin/calcite.nix
+++ b/home/xin/calcite.nix
@@ -122,6 +122,7 @@ in
     enable = true;
     options = {
       recolor = false;
+      selection-clipboard = "clipboard";
     };
   };
 
diff --git a/machines/calcite/configuration.nix b/machines/calcite/configuration.nix
index e5a74ea..c9afcd5 100644
--- a/machines/calcite/configuration.nix
+++ b/machines/calcite/configuration.nix
@@ -188,8 +188,8 @@ in
   services.printing.enable = true;
   services.printing.drivers = [
     pkgs.hplip
+    pkgs.gutenprint
     pkgs.gutenprintBin
-    pkgs.canon-cups-ufr2
   ];
   hardware.sane = {
     enable = true;
diff --git a/machines/calcite/network.nix b/machines/calcite/network.nix
index 27e77ee..0626cc9 100644
--- a/machines/calcite/network.nix
+++ b/machines/calcite/network.nix
@@ -12,19 +12,41 @@
   networking = {
     networkmanager = {
       enable = true;
-      dns = "systemd-resolved";
+      dns = "default";
+      settings = {
+        main = {
+          rc-manager = "resolvconf";
+        };
+      };
     };
   };
 
-  services.resolved = {
+  networking.resolvconf = {
     enable = true;
+    dnsExtensionMechanism = false;
+    useLocalResolver = false;
+  };
+
+  services.kresd = {
+    enable = true;
+    listenPlain = [ ];
     extraConfig = ''
-      Cache=no
+      log_level("notice")
+      net.listen('127.0.0.1', 53)
+      modules = { 'hints > iterate', 'stats', 'predict' }
+      cache.size = 100 * MB
+      trust_anchors.remove(".")
+      policy.add(policy.all(policy.TLS_FORWARD( {
+        { "8.8.8.8", hostname="dns.google" } })))
     '';
+      # policy.add(policy.suffix(policy.FORWARD({ "100.100.100.100" }), policy.todnames({ 'coho-tet.ts.net' })))
   };
 
   # Enable Tailscale
-  services.tailscale.enable = true;
+  services.tailscale = {
+    enable = true;
+    extraUpFlags = [ "--accept-dns=false" ];
+  };
   # services.tailscale.useRoutingFeatures = "both";
 
   services.dae.enable = true;