this repo has no description
1
fork

Configure Feed

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

Add Tangled Spindle

Ben C d6269205 9f3baebe

+71 -17
+10 -1
nixosConfigurations/black-mesa.nix
··· 128 128 hostname = "pds.bwc9876.dev"; 129 129 }; 130 130 tangled = { 131 - hostname = "knot.bwc9876.dev"; 132 131 knot = { 133 132 enable = true; 133 + hostname = "knot.bwc9876.dev"; 134 134 gitUser = "gurt"; 135 + }; 136 + spindle = { 137 + enable = true; 138 + hostname = "spindle.bwc9876.dev"; 135 139 }; 136 140 }; 137 141 imperm.keep = ["/var/lib/acme"]; ··· 156 160 virtualHosts."knot.bwc9876.dev" = { 157 161 addSSL = true; 158 162 acmeRoot = null; # Doing DNS challenges 163 + useACMEHost = "bwc9876.dev"; 164 + }; 165 + virtualHosts."spindle.bwc9876.dev" = { 166 + addSSL = true; 167 + acmeRoot = null; # DNS 159 168 useACMEHost = "bwc9876.dev"; 160 169 }; 161 170 virtualHosts."pds.bwc9876.dev" = {
+61 -16
nixosModules/tangled.nix
··· 4 4 lib, 5 5 ... 6 6 }: { 7 - imports = [inputs.tangled.nixosModules.knot]; 7 + imports = [ 8 + inputs.tangled.nixosModules.knot 9 + inputs.tangled.nixosModules.spindle 10 + ]; 8 11 9 12 options.cow.tangled = { 10 - hostname = lib.mkOption { 11 - type = lib.types.str; 12 - description = "virtual host for knot and spindle"; 13 - default = "knot.bwc9876.dev"; 13 + spindle = { 14 + enable = lib.mkEnableOption "tangled spindle service"; 15 + port = lib.mkOption { 16 + type = lib.types.port; 17 + default = 6555; 18 + description = "port to run spindle on"; 19 + }; 20 + hostname = lib.mkOption { 21 + type = lib.types.str; 22 + description = "virtual host for spindle"; 23 + }; 14 24 }; 15 25 knot = { 16 26 enable = lib.mkEnableOption "tangled knot service"; 27 + hostname = lib.mkOption { 28 + type = lib.types.str; 29 + description = "virtual host for knot"; 30 + }; 17 31 gitUser = lib.mkOption { 18 32 type = lib.types.str; 19 33 description = "Name of git user for SSH operations"; ··· 40 54 config = let 41 55 conf = config.cow.tangled; 42 56 in { 43 - cow.imperm.keep = lib.optional conf.knot.enable conf.knot.stateDir; 57 + cow.imperm.keep = 58 + (lib.optional conf.knot.enable conf.knot.stateDir) 59 + ++ (lib.optionals conf.spindle.enable ["/var/lib/spindle" "/var/lib/docker"]); 44 60 45 61 services.tangled = { 46 62 knot = lib.mkIf conf.knot.enable { ··· 51 67 server = { 52 68 listenAddr = "0.0.0.0:${builtins.toString conf.knot.port}"; 53 69 internalListenAddr = "127.0.0.1:${builtins.toString conf.knot.internalPort}"; 54 - hostname = lib.mkDefault conf.hostname; 70 + hostname = lib.mkDefault conf.knot.hostname; 71 + owner = lib.mkIf config.cow.bean.enable (lib.mkDefault config.cow.bean.atproto.did); 72 + }; 73 + }; 74 + spindle = lib.mkIf conf.spindle.enable { 75 + enable = true; 76 + server = { 77 + listenAddr = "0.0.0.0:${builtins.toString conf.spindle.port}"; 55 78 owner = lib.mkIf config.cow.bean.enable (lib.mkDefault config.cow.bean.atproto.did); 79 + hostname = lib.mkDefault conf.spindle.hostname; 56 80 }; 57 81 }; 58 82 }; 59 83 60 - services.nginx.virtualHosts.${conf.hostname} = lib.mkIf conf.knot.enable { 61 - locations = { 62 - "/" = { 63 - proxyPass = "http://localhost:${builtins.toString conf.knot.port}"; 64 - recommendedProxySettings = true; 84 + services.nginx.virtualHosts = { 85 + ${conf.knot.hostname} = lib.mkIf conf.knot.enable { 86 + locations = { 87 + "/" = { 88 + proxyPass = "http://localhost:${builtins.toString conf.knot.port}"; 89 + recommendedProxySettings = true; 90 + }; 91 + "/events" = { 92 + proxyPass = "http://localhost:${builtins.toString conf.knot.port}"; 93 + proxyWebsockets = true; 94 + recommendedProxySettings = true; 95 + }; 65 96 }; 66 - "/events" = { 67 - proxyPass = "http://localhost:${builtins.toString conf.knot.port}"; 68 - proxyWebsockets = true; 69 - recommendedProxySettings = true; 97 + }; 98 + 99 + ${conf.spindle.hostname} = lib.mkIf conf.spindle.enable { 100 + locations = { 101 + "/" = { 102 + proxyPass = "http://localhost:${builtins.toString conf.spindle.port}"; 103 + recommendedProxySettings = true; 104 + }; 105 + "/events" = { 106 + proxyPass = "http://localhost:${builtins.toString conf.spindle.port}"; 107 + proxyWebsockets = true; 108 + recommendedProxySettings = true; 109 + }; 110 + "/logs" = { 111 + proxyPass = "http://localhost:${builtins.toString conf.spindle.port}"; 112 + proxyWebsockets = true; 113 + recommendedProxySettings = true; 114 + }; 70 115 }; 71 116 }; 72 117 };