Deploy Panettone to whitby as a systemd service, proxied to from an nginx virtual host listening at b.tvl.fyi Change-Id: I69755566151a45120e6b3453751af0e9291fa241 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1339 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
		
			
				
	
	
		
			34 lines
		
	
	
	
		
			784 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
	
		
			784 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
| { config, lib, pkgs, ... }:
 | |
| 
 | |
| let
 | |
|   cfg = config.services.depot.panettone;
 | |
|   depot = config.depot;
 | |
| in {
 | |
|   options.services.depot.panettone = with lib; {
 | |
|     enable = mkEnableOption "Panettone issue tracker";
 | |
| 
 | |
|     port = mkOption {
 | |
|       description = "Port on which Panettone should listen";
 | |
|       type = types.int;
 | |
|       default = 7268;
 | |
|     };
 | |
|   };
 | |
| 
 | |
|   config = lib.mkIf cfg.enable {
 | |
|     systemd.services.panettone = {
 | |
|       wantedBy = [ "multi-user.target" ];
 | |
|       script = "${depot.web.panettone}/bin/panettone";
 | |
| 
 | |
|       serviceConfig = {
 | |
|         DynamicUser = true;
 | |
|         Restart = "always";
 | |
|         StateDirectory = "panettone";
 | |
|       };
 | |
| 
 | |
|       environment = {
 | |
|         PANETTONE_PORT = toString cfg.port;
 | |
|         PANETTONE_DATA_DIR = "/var/lib/panettone";
 | |
|       };
 | |
|     };
 | |
|   };
 | |
| }
 |