34 lines
		
	
	
		
			967 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			967 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
| { pkgs, ... }:
 | |
| {
 | |
|   environment.systemPackages = [ pkgs.beets ];
 | |
|   services.transmission = {
 | |
|     enable = true;
 | |
|     settings = {
 | |
|       rpc-enabled = true;
 | |
|       rpc-bind-address = "0.0.0.0";
 | |
|       rpc-whitelist-enabled = false;
 | |
|       script-torrent-done-enabled = true;
 | |
|       # Normally, I would write this into the homedir with home-manager
 | |
|       # And explictly set the dir to be the output of the home-manager location
 | |
|       script-torrent-done-filename = pkgs.writeShellScript "beet-import.sh" ''
 | |
| #!/usr/bin/env bash
 | |
| 
 | |
| beet -p fetchart  import -l /home/anish/music.log -q -g "$TR_TORRENT_DIR"
 | |
|       '';
 | |
|       rpc-url = "/transmission/rpc/";
 | |
|       download-dir = "/mnt/two/new-music";
 | |
|     };
 | |
|   };
 | |
|   services.nginx.virtualHosts."transmission.mossnet.lan" = {
 | |
|     enableACME = false;
 | |
|     forceSSL = false;
 | |
| 
 | |
|     locations."/" = {
 | |
|       extraConfig = ''
 | |
|         proxy_pass http://localhost:9091/;
 | |
|         proxy_set_header X-Forwarded-Host $host;
 | |
|       '';
 | |
|     };
 | |
|   };
 | |
| }
 |