mirror of
				https://github.com/Stunkymonkey/nixos.git
				synced 2025-11-04 03:26:57 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			38 lines
		
	
	
	
		
			736 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
	
		
			736 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
# manages and downloads films
 | 
						|
{ config, lib, pkgs, ... }:
 | 
						|
let
 | 
						|
  cfg = config.my.services.radarr;
 | 
						|
  domain = config.networking.domain;
 | 
						|
  port = 7878;
 | 
						|
in
 | 
						|
{
 | 
						|
  options.my.services.radarr = with lib; {
 | 
						|
    enable = mkEnableOption "Sonarr for films management";
 | 
						|
  };
 | 
						|
 | 
						|
  config = lib.mkIf cfg.enable {
 | 
						|
    services.radarr = {
 | 
						|
      enable = true;
 | 
						|
    };
 | 
						|
 | 
						|
    systemd.services.radarr = {
 | 
						|
      after = [ "network-online.target" ];
 | 
						|
    };
 | 
						|
 | 
						|
    my.services.nginx.virtualHosts = [
 | 
						|
      {
 | 
						|
        subdomain = "movies";
 | 
						|
        inherit port;
 | 
						|
      }
 | 
						|
    ];
 | 
						|
 | 
						|
    webapps.apps.radarr = {
 | 
						|
      dashboard = {
 | 
						|
        name = "Radarr";
 | 
						|
        category = "media";
 | 
						|
        icon = "film";
 | 
						|
        link = "https://movies.${domain}";
 | 
						|
      };
 | 
						|
    };
 | 
						|
  };
 | 
						|
}
 |