This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

superconfig / nixos / 2configs / cunicu.nix
1.7 kB 68 lines
1{ config, lib, pkgs, ... }: 2{ 3 environment.systemPackages = [ 4 pkgs.cunicu 5 ]; 6 7 networking.firewall.allowedUDPPorts = [ 42230 ]; 8 9 environment.etc."cunicu.yaml".text = builtins.toJSON { 10 # backends = [ 11 # "grpc://signal.cunicu.li:443" 12 # ]; 13 rpc.socket = "/var/run/cunicu.sock"; 14 15 listen_port = 51820; 16 17 sync_routes = true; 18 sync_hosts = true; 19 20 domain = "c"; 21 22 discover_peers = true; 23 discover_endpoints = true; 24 community = "aidsballs"; 25 26 networks = [ 27 "10.245.0.0/16" 28 ]; 29 30 ice = { 31 urls = [ 32 "stun:stun3.l.google.com:19302" 33 "stun:relay.webwormhole.io" 34 "stun:stun.sipgate.net" 35 "stun:stun.ekiga.net" 36 "stun:stun.services.mozilla.com" 37 ]; 38 interface_filter = "w*|e*|v*|i*"; 39 }; 40 41 interfaces.wiregrill = {}; 42 43 peers = lib.mapAttrs 44 (_: host: { 45 public_key = host.nets.wiregrill.wireguard.pubkey; 46 allowed_ips = with host.nets.wiregrill; [ 47 "${ip6.addr}/128" 48 ] ++ (lib.optional (ip4 != null) "${ip4.addr}/32"); 49 } // lib.optionalAttrs (host.nets.wiregrill.via != null) { 50 endpoint = host.nets.wiregrill.via.ip4.addr + ":${toString host.nets.wiregrill.wireguard.port}"; 51 }) 52 (lib.filterAttrs (_: host: lib.hasAttr "wiregrill" host.nets) config.krebs.hosts); 53 }; 54 55 systemd.services.cunicu = { 56 wantedBy = [ "multi-user.target" ]; 57 restartTriggers = [ config.environment.etc."cunicu.yaml".source ]; 58 environment = { 59 CUNICU_CONFIG_ALLOW_INSECURE = "true"; 60 CUNICU_EXPERIMENTAL = "true"; 61 }; 62 serviceConfig = { 63 ExecStart = pkgs.writers.writeDash "cunicu" '' 64 ${pkgs.cunicu}/bin/cunicu daemon 65 ''; 66 }; 67 }; 68}