forked from jan-leila/nix-config
		
	updated jellyfin persist folders
This commit is contained in:
		
							parent
							
								
									0d952467cc
								
							
						
					
					
						commit
						e7a53a5df0
					
				
					 1 changed files with 44 additions and 28 deletions
				
			
		|  | @ -7,6 +7,7 @@ | ||||||
|   jellyfinPort = 8096; |   jellyfinPort = 8096; | ||||||
|   jellyfin_data_directory = "/var/lib/jellyfin"; |   jellyfin_data_directory = "/var/lib/jellyfin"; | ||||||
|   jellyfin_cache_directory = "/var/cache/jellyfin"; |   jellyfin_cache_directory = "/var/cache/jellyfin"; | ||||||
|  |   jellyfin_media_directory = "/srv/jellyfin/media"; | ||||||
| in { | in { | ||||||
|   options.host.jellyfin = { |   options.host.jellyfin = { | ||||||
|     enable = lib.mkEnableOption "should jellyfin be enabled on this computer"; |     enable = lib.mkEnableOption "should jellyfin be enabled on this computer"; | ||||||
|  | @ -31,6 +32,21 @@ in { | ||||||
|         ]; |         ]; | ||||||
|       } |       } | ||||||
|       (lib.mkIf config.host.impermanence.enable { |       (lib.mkIf config.host.impermanence.enable { | ||||||
|  |         fileSystems."/persist/system/jellyfin".neededForBoot = true; | ||||||
|  | 
 | ||||||
|  |         host.storage.pool.extraDatasets = { | ||||||
|  |           # sops age key needs to be available to pre persist for user generation | ||||||
|  |           "persist/system/jellyfin" = { | ||||||
|  |             type = "zfs_fs"; | ||||||
|  |             mountpoint = "/persist/system/jellyfin"; | ||||||
|  |             options = { | ||||||
|  |               atime = "off"; | ||||||
|  |               relatime = "off"; | ||||||
|  |               canmount = "on"; | ||||||
|  |             }; | ||||||
|  |           }; | ||||||
|  |         }; | ||||||
|  | 
 | ||||||
|         assertions = [ |         assertions = [ | ||||||
|           { |           { | ||||||
|             assertion = config.services.jellyfin.dataDir == jellyfin_data_directory; |             assertion = config.services.jellyfin.dataDir == jellyfin_data_directory; | ||||||
|  | @ -42,7 +58,8 @@ in { | ||||||
|           } |           } | ||||||
|         ]; |         ]; | ||||||
| 
 | 
 | ||||||
|         environment.persistence."/persist/system/jellyfin" = { |         environment.persistence = { | ||||||
|  |           "/persist/system/root" = { | ||||||
|             enable = true; |             enable = true; | ||||||
|             hideMounts = true; |             hideMounts = true; | ||||||
|             directories = [ |             directories = [ | ||||||
|  | @ -59,18 +76,17 @@ in { | ||||||
|             ]; |             ]; | ||||||
|           }; |           }; | ||||||
| 
 | 
 | ||||||
|         fileSystems."/persist/system/jellyfin".neededForBoot = true; |           "/persist/system/jellyfin" = { | ||||||
| 
 |             enable = true; | ||||||
|         host.storage.pool.extraDatasets = { |             hideMounts = true; | ||||||
|           # sops age key needs to be available to pre persist for user generation |             directories = [ | ||||||
|           "persist/system/jellyfin" = { |               { | ||||||
|             type = "zfs_fs"; |                 directory = jellyfin_media_directory; | ||||||
|             mountpoint = "/persist/system/jellyfin"; |                 user = "jellyfin"; | ||||||
|             options = { |                 group = "jellyfin_media"; | ||||||
|               atime = "off"; |                 mode = "1770"; | ||||||
|               relatime = "off"; |               } | ||||||
|               canmount = "on"; |             ]; | ||||||
|             }; |  | ||||||
|           }; |           }; | ||||||
|         }; |         }; | ||||||
|       }) |       }) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue