add transfer.sh module
This commit is contained in:
		
							parent
							
								
									484965e504
								
							
						
					
					
						commit
						adf6aa063c
					
				
					 3 changed files with 35 additions and 0 deletions
				
			
		| 
						 | 
					@ -20,6 +20,7 @@
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    users.deploy.enable = true;
 | 
					    users.deploy.enable = true;
 | 
				
			||||||
    programs = {
 | 
					    programs = {
 | 
				
			||||||
 | 
					      transfer-sh.enable = true;
 | 
				
			||||||
      rustypaste = {
 | 
					      rustypaste = {
 | 
				
			||||||
        enable = true;
 | 
					        enable = true;
 | 
				
			||||||
        url = "https://paste.youthlic.fun";
 | 
					        url = "https://paste.youthlic.fun";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,7 @@
 | 
				
			||||||
{ config, lib, ... }:
 | 
					{ config, lib, ... }:
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  imports = [
 | 
					  imports = [
 | 
				
			||||||
 | 
					    ./transfer-sh.nix
 | 
				
			||||||
    ./rustypaste
 | 
					    ./rustypaste
 | 
				
			||||||
    ./mautrix-telegram.nix
 | 
					    ./mautrix-telegram.nix
 | 
				
			||||||
    ./caddy.nix
 | 
					    ./caddy.nix
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										33
									
								
								nixos/modules/programs/transfer-sh.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								nixos/modules/programs/transfer-sh.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,33 @@
 | 
				
			||||||
 | 
					{ lib, config, ... }:
 | 
				
			||||||
 | 
					let
 | 
				
			||||||
 | 
					  cfg = config.youthlic.programs.transfer-sh;
 | 
				
			||||||
 | 
					in
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  options = {
 | 
				
			||||||
 | 
					    youthlic.programs.transfer-sh = {
 | 
				
			||||||
 | 
					      enable = lib.mkEnableOption "transfer.sh";
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					  config = lib.mkMerge [
 | 
				
			||||||
 | 
					    (lib.mkIf cfg.enable {
 | 
				
			||||||
 | 
					      services.transfer-sh = {
 | 
				
			||||||
 | 
					        enable = true;
 | 
				
			||||||
 | 
					        provider = "local";
 | 
				
			||||||
 | 
					        settings = {
 | 
				
			||||||
 | 
					          BASEDIR = "/var/lib/transfer.sh";
 | 
				
			||||||
 | 
					          LISTENER = ":8484";
 | 
				
			||||||
 | 
					          TLS_LISTENER_ONLY = false;
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					    })
 | 
				
			||||||
 | 
					    (lib.mkIf (cfg.enable && config.youthlic.programs.caddy.enable) {
 | 
				
			||||||
 | 
					      services.caddy.virtualHosts = {
 | 
				
			||||||
 | 
					        "transfer.${config.youthlic.programs.caddy.baseDomain}" = {
 | 
				
			||||||
 | 
					          extraConfig = ''
 | 
				
			||||||
 | 
					            reverse_proxy 127.0.0.1:8484
 | 
				
			||||||
 | 
					          '';
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					    })
 | 
				
			||||||
 | 
					  ];
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue