feat: init media server system profile
This commit is contained in:
		
							parent
							
								
									d2bd5abbed
								
							
						
					
					
						commit
						dc8a3d5dd1
					
				
					 7 changed files with 71 additions and 2 deletions
				
			
		|  | @ -6,7 +6,7 @@ | ||||||
|     ../../profiles |     ../../profiles | ||||||
| 		]; | 		]; | ||||||
| 
 | 
 | ||||||
|     activeProfiles = ["base" "nvidia"]; |     activeProfiles = ["base" "nvidia" "mediaServer"]; | ||||||
| 
 | 
 | ||||||
| 		systemModules.user = { | 		systemModules.user = { | ||||||
| 			ooks.enable = true; | 			ooks.enable = true; | ||||||
|  | @ -15,7 +15,7 @@ | ||||||
|   	 |   	 | ||||||
| 		networking = { | 		networking = { | ||||||
|   		hostName = "ooksdesk"; 		 |   		hostName = "ooksdesk"; 		 | ||||||
| 			useDHCP = true; | 			# useDHCP = true; | ||||||
| 		}; | 		}; | ||||||
|     boot = { |     boot = { | ||||||
|       kernelPackages = pkgs.linuxKernel.packages.linux_zen; |       kernelPackages = pkgs.linuxKernel.packages.linux_zen; | ||||||
|  |  | ||||||
|  | @ -13,6 +13,7 @@ | ||||||
|     ./virtualisation.nix |     ./virtualisation.nix | ||||||
|     ./pipewire.nix |     ./pipewire.nix | ||||||
|     ./security.nix |     ./security.nix | ||||||
|  |     ./services | ||||||
|   ]; |   ]; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										14
									
								
								system/modules/services/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								system/modules/services/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,14 @@ | ||||||
|  | { lib, ... }: | ||||||
|  | 
 | ||||||
|  | { | ||||||
|  |   imports = [  | ||||||
|  |   ./jellyfin | ||||||
|  |   ]; | ||||||
|  | 
 | ||||||
|  |   options.systemModules.services = { | ||||||
|  |     jellyfin = { | ||||||
|  |       enable = lib.mkEnableOption "Enable jellyfin service module"; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  |    | ||||||
|  | } | ||||||
							
								
								
									
										32
									
								
								system/modules/services/jellyfin/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								system/modules/services/jellyfin/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,32 @@ | ||||||
|  | { config, lib, pkgs, ... }: | ||||||
|  | 
 | ||||||
|  | let | ||||||
|  |   cfg = config.systemModules.services.jellyfin; | ||||||
|  | in | ||||||
|  | 
 | ||||||
|  | { | ||||||
|  |   config = lib.mkIf cfg.enable { | ||||||
|  |     environment.systemPackages = with pkgs; [ | ||||||
|  |       jellyfin | ||||||
|  |       jellyfin-web | ||||||
|  |       jellyfin-ffmpeg  | ||||||
|  |     ]; | ||||||
|  |     services.jellyfin = { | ||||||
|  |       user = "jellyfin"; | ||||||
|  |       group = "media"; | ||||||
|  |       enable = true; | ||||||
|  |       openFirewall = true; | ||||||
|  |     }; | ||||||
|  |     users.users.jellyfin = { | ||||||
|  |       isSystemUser = true; | ||||||
|  |       group = "media"; | ||||||
|  |     }; | ||||||
|  |     users.groups.media = {}; | ||||||
|  | 
 | ||||||
|  |     fileSystems."/media" = { | ||||||
|  |       device = "/dev/disk/by-label/ooksmedia"; | ||||||
|  |       fsType = "ntfs"; | ||||||
|  |       options = [ "rw" "uid=1000" "gid=991" "umask=002" ]; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | } | ||||||
|  | @ -15,6 +15,7 @@ in | ||||||
|       "audio" |       "audio" | ||||||
|       ] ++ ifTheyExist [ |       ] ++ ifTheyExist [ | ||||||
|       "git" |       "git" | ||||||
|  |       "media" | ||||||
|       "network" |       "network" | ||||||
|       "libvirtd" |       "libvirtd" | ||||||
|       "deluge" |       "deluge" | ||||||
|  |  | ||||||
|  | @ -12,6 +12,7 @@ in | ||||||
|     ./nvidia |     ./nvidia | ||||||
|     ./gaming |     ./gaming | ||||||
|     ./laptop |     ./laptop | ||||||
|  |     ./mediaServer | ||||||
|   ]; |   ]; | ||||||
| 
 | 
 | ||||||
|   options = { |   options = { | ||||||
|  | @ -33,6 +34,9 @@ in | ||||||
|       nvidia = { |       nvidia = { | ||||||
|         enable = lib.mkEnableOption "Enable the nvidia profile"; |         enable = lib.mkEnableOption "Enable the nvidia profile"; | ||||||
|       }; |       }; | ||||||
|  |       mediaServer = { | ||||||
|  |         enable = lib.mkEnableOption "Enable the mediaServer profile"; | ||||||
|  |       }; | ||||||
|     }; |     }; | ||||||
|   }; |   }; | ||||||
|    |    | ||||||
|  |  | ||||||
							
								
								
									
										17
									
								
								system/profiles/mediaServer/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								system/profiles/mediaServer/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | ||||||
|  | { config, lib, ... }: | ||||||
|  | let | ||||||
|  |   cfg = config.systemProfile.mediaServer; | ||||||
|  | in  | ||||||
|  | { | ||||||
|  |   imports = [ | ||||||
|  |     ../../modules | ||||||
|  |   ]; | ||||||
|  |    | ||||||
|  |   config = lib.mkIf cfg.enable { | ||||||
|  |     systemModules = { | ||||||
|  |       services = { | ||||||
|  |         jellyfin.enable = true; | ||||||
|  |       }; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | } | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue