forked from jan-leila/nix-config
		
	
		
			
				
	
	
		
			33 lines
		
	
	
	
		
			779 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
	
		
			779 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
{
 | 
						|
  lib,
 | 
						|
  config,
 | 
						|
  ...
 | 
						|
}: let
 | 
						|
  jackett_data_directory = "/var/lib/jackett/.config/Jackett";
 | 
						|
in {
 | 
						|
  options.services.jackett = {
 | 
						|
    impermanence.enable = lib.mkOption {
 | 
						|
      type = lib.types.bool;
 | 
						|
      default = config.services.jackett.enable && config.host.impermanence.enable;
 | 
						|
    };
 | 
						|
  };
 | 
						|
 | 
						|
  config = lib.mkIf config.services.jackett.impermanence.enable {
 | 
						|
    assertions = [
 | 
						|
      {
 | 
						|
        assertion = config.services.jackett.dataDir == jackett_data_directory;
 | 
						|
        message = "jackett data directory does not match persistence";
 | 
						|
      }
 | 
						|
    ];
 | 
						|
 | 
						|
    environment.persistence."/persist/system/root" = {
 | 
						|
      directories = [
 | 
						|
        {
 | 
						|
          directory = jackett_data_directory;
 | 
						|
          user = "jackett";
 | 
						|
          group = "jackett";
 | 
						|
        }
 | 
						|
      ];
 | 
						|
    };
 | 
						|
  };
 | 
						|
}
 |