feat: removed filebot
This commit is contained in:
		
							parent
							
								
									f02cb08570
								
							
						
					
					
						commit
						e895fa5edd
					
				
					 3 changed files with 3 additions and 91 deletions
				
			
		|  | @ -350,21 +350,16 @@ | |||
|       webuiPort = 8084; | ||||
|     }; | ||||
| 
 | ||||
|     filebot-cleanup = { | ||||
|       enable = false; | ||||
|       licenseFile = "/srv/jellyfin/filebot_license.psm"; | ||||
|     }; | ||||
| 
 | ||||
|     sonarr = { | ||||
|       enable = false; | ||||
|       enable = true; | ||||
|       openFirewall = true; | ||||
|     }; | ||||
|     radarr = { | ||||
|       enable = false; | ||||
|       enable = true; | ||||
|       openFirewall = true; | ||||
|     }; | ||||
|     bazarr = { | ||||
|       enable = false; | ||||
|       enable = true; | ||||
|       openFirewall = true; | ||||
|     }; | ||||
|   }; | ||||
|  |  | |||
|  | @ -4,6 +4,5 @@ | |||
|     ./hardware-configuration.nix | ||||
|     ./configuration.nix | ||||
|     ./packages.nix | ||||
|     ./filebot.nix | ||||
|   ]; | ||||
| } | ||||
|  |  | |||
|  | @ -1,82 +0,0 @@ | |||
| { | ||||
|   config, | ||||
|   lib, | ||||
|   pkgs, | ||||
|   ... | ||||
| }: | ||||
| with lib; let | ||||
|   cfg = config.services.filebot-cleanup; | ||||
| in { | ||||
|   options.services.filebot-cleanup = { | ||||
|     enable = mkEnableOption "Filebot cleanup service"; | ||||
| 
 | ||||
|     licenseFile = mkOption { | ||||
|       type = types.nullOr types.path; | ||||
|       default = null; | ||||
|       description = "Path to the Filebot license file"; | ||||
|     }; | ||||
| 
 | ||||
|     cleanupDirectory = mkOption { | ||||
|       type = types.str; | ||||
|       default = "/srv/jellyfin/filebot_cleanup"; | ||||
|       description = "Directory where cleaned up media files are stored"; | ||||
|     }; | ||||
|   }; | ||||
| 
 | ||||
|   config = mkIf cfg.enable { | ||||
|     users.groups.filebot_cleanup = {}; | ||||
|     users.users.filebot_cleanup = { | ||||
|       isSystemUser = true; | ||||
|       group = "filebot_cleanup"; | ||||
|       extraGroups = ["jellyfin_media"]; | ||||
|       home = cfg.cleanupDirectory; | ||||
|       createHome = true; | ||||
|     }; | ||||
| 
 | ||||
|     nixpkgs.config.allowUnfreePredicate = pkg: | ||||
|       builtins.elem (lib.getName pkg) [ | ||||
|         "filebot" | ||||
|       ]; | ||||
| 
 | ||||
|     environment.systemPackages = with pkgs; [ | ||||
|       filebot | ||||
|     ]; | ||||
| 
 | ||||
|     systemd.services.filebot-cleanup = { | ||||
|       description = "Filebot media cleanup service"; | ||||
|       serviceConfig = { | ||||
|         Type = "simple"; | ||||
|         User = "filebot_cleanup"; | ||||
|         Group = "filebot_cleanup"; | ||||
|         ExecStart = pkgs.writeShellScript "filebot-cleanup" '' | ||||
|           ${optionalString (cfg.licenseFile != null) '' | ||||
|             ${pkgs.filebot}/bin/filebot --license "${cfg.licenseFile}" | ||||
|           ''} | ||||
|           ${pkgs.filebot}/bin/filebot -rename -r "/srv/jellyfin/media/Movies/" --output "${cfg.cleanupDirectory}/" --format "{jellyfin}" -non-strict --action duplicate | ||||
|           ${pkgs.filebot}/bin/filebot -rename -r "/srv/jellyfin/media/Shows/" --output "${cfg.cleanupDirectory}/" --format "{jellyfin}" -non-strict --action duplicate | ||||
|         ''; | ||||
|         StandardOutput = "journal"; | ||||
|         StandardError = "journal"; | ||||
|       }; | ||||
|       wantedBy = ["multi-user.target"]; | ||||
|     }; | ||||
| 
 | ||||
|     environment.persistence = lib.mkIf config.host.impermanence.enable { | ||||
|       "/persist/system/jellyfin" = { | ||||
|         enable = true; | ||||
|         hideMounts = true; | ||||
|         files = [ | ||||
|           cfg.licenseFile | ||||
|         ]; | ||||
|         directories = [ | ||||
|           { | ||||
|             directory = cfg.cleanupDirectory; | ||||
|             user = "filebot_cleanup"; | ||||
|             group = "filebot_cleanup"; | ||||
|             mode = "1770"; | ||||
|           } | ||||
|         ]; | ||||
|       }; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue