Compare commits
	
		
			No commits in common. "5d037f9122e68aaa5db62d04810bf0c5e1e4325e" and "6c29bc5db001e75f5ca06fec726369b87d007a03" have entirely different histories.
		
	
	
		
			5d037f9122
			...
			6c29bc5db0
		
	
		
					 2 changed files with 24 additions and 26 deletions
				
			
		|  | @ -4,38 +4,32 @@ | |||
| }: | ||||
| nixosTest { | ||||
|   nodes = { | ||||
|     # Host with just the default configuration | ||||
|     defaults = { | ||||
|       imports = [self.nixosModules.default]; | ||||
|       services.tlaternet-webserver.enable = true; | ||||
|     }; | ||||
| 
 | ||||
|     host = { | ||||
|       config, | ||||
|       lib, | ||||
|       pkgs, | ||||
|       ... | ||||
|     }: { | ||||
|       imports = [self.nixosModules.default]; | ||||
| 
 | ||||
|       services.tlaternet-webserver = { | ||||
|         enable = true; | ||||
|         listen = { | ||||
|           addr = "0.0.0.0"; | ||||
|           port = 8080; | ||||
|           port = 8000; | ||||
|         }; | ||||
|       }; | ||||
| 
 | ||||
|       networking.firewall.allowedTCPPorts = [8080]; | ||||
|       networking.firewall.allowedTCPPorts = [8000]; | ||||
|     }; | ||||
| 
 | ||||
|     client = {}; | ||||
|     client = {pkgs, ...}: {}; | ||||
|   }; | ||||
| 
 | ||||
|   testScript = '' | ||||
|     start_all() | ||||
| 
 | ||||
|     # Assert that the defaults work | ||||
|     defaults.wait_for_unit("tlaternet-webserver.service") | ||||
|     defaults.succeed("curl --fail http://localhost:8000 >&2") | ||||
| 
 | ||||
|     # Assert that we can listen on a public interface | ||||
|     host.wait_for_unit("tlaternet-webserver.service") | ||||
|     client.succeed("curl --fail http://host:8080 >&2") | ||||
|     host.wait_for_unit("default.target") | ||||
|     client.succeed("curl --fail http://host:8000/ >&2") | ||||
|   ''; | ||||
| } | ||||
|  |  | |||
|  | @ -16,7 +16,9 @@ in { | |||
|   options = { | ||||
|     services.tlaternet-webserver = { | ||||
|       enable = mkEnableOption "tlaternet web server"; | ||||
|       listen = { | ||||
|       listen = mkOption { | ||||
|         type = submodule { | ||||
|           options = { | ||||
|             addr = mkOption { | ||||
|               type = str; | ||||
|               description = "IP address."; | ||||
|  | @ -31,6 +33,8 @@ in { | |||
|           }; | ||||
|         }; | ||||
|       }; | ||||
|     }; | ||||
|   }; | ||||
| 
 | ||||
|   config = mkIf cfg.enable { | ||||
|     systemd.services.tlaternet-webserver = { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue