35 lines
		
	
	
	
		
			755 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
	
		
			755 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
{
 | 
						|
  inputs,
 | 
						|
  config,
 | 
						|
  pkgs,
 | 
						|
  lib,
 | 
						|
  ...
 | 
						|
}: let
 | 
						|
  port = "8080";
 | 
						|
in {
 | 
						|
  systemd.services.miniserve = {
 | 
						|
    wantedBy = ["multi-user.target"];
 | 
						|
    after = ["network.target"];
 | 
						|
    description = "A directory listing miniserve instance";
 | 
						|
    serviceConfig = {
 | 
						|
      ExecStart = lib.concatStringsSep " " [
 | 
						|
        "${pkgs.miniserve}/bin/miniserve"
 | 
						|
        "--enable-tar-gz"
 | 
						|
        "--show-wget-footer"
 | 
						|
        "--readme"
 | 
						|
        "--port ${port}"
 | 
						|
        "--qrcode"
 | 
						|
        # "--no-symlinks"
 | 
						|
        "--interfaces 127.0.0.1"
 | 
						|
        "/storage/miniserve"
 | 
						|
      ];
 | 
						|
    };
 | 
						|
  };
 | 
						|
  services.nginx.virtualHosts."directory.venberg.xyz" = {
 | 
						|
    enableACME = true;
 | 
						|
    forceSSL = true;
 | 
						|
    locations."/" = {
 | 
						|
      proxyPass = "http://localhost:${port}";
 | 
						|
    };
 | 
						|
  };
 | 
						|
}
 |