about summary refs log tree commit diff
path: root/modules/shadowsocks.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/shadowsocks.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/shadowsocks.nix b/modules/shadowsocks.nix
index 670faec..1d55cf5 100644
--- a/modules/shadowsocks.nix
+++ b/modules/shadowsocks.nix
@@ -3,6 +3,7 @@
   inputs,
   lib,
   pkgs,
+  this,
   ...
 }:
 with lib;
@@ -129,5 +130,16 @@ in
       "net.ipv4.tcp_mtu_probing" = 1;
       "net.ipv4.tcp_congestion_control" = "hybla";
     };
+
+    topology = with cfg; {
+      nodes.${this.hostname}.services.shadowsocks = {
+        name = "Shadowsocks";
+        icon = pkgs.fetchurl {
+          url = "https://upload.wikimedia.org/wikipedia/commons/f/f5/Shadowsocks-Logo.svg";
+          sha256 = "sha256-NzGt0WQA4NQpMPsOTWgBrghuewxQeDoSe46oTm0f+BY=";
+        };
+        details.listen.text = ":::${toString port}";
+      };
+    };
   };
 }

Consider giving Nix/NixOS a try! <3