refactor(systemModules:sound): conditionally enable if host.function is valid
This commit is contained in:
		
							parent
							
								
									0177c1fd7c
								
							
						
					
					
						commit
						779603c4cc
					
				
					 1 changed files with 7 additions and 3 deletions
				
			
		|  | @ -1,16 +1,20 @@ | |||
| { config, lib, pkgs, ... }: | ||||
| 
 | ||||
| let | ||||
|   cfg = config.systemModules.pipewire; | ||||
|   inherit (lib) mkIf; | ||||
|   inherit (lib.generators) toLua; | ||||
|   inherit (lib.lists) optionals; | ||||
|   hasBT = (builtins.elem "bluetooth" config.systemModules.hardware.features); | ||||
|   inherit (builtins) elem; | ||||
|   hasBT = (elem "bluetooth" config.systemModules.hardware.features); | ||||
|   host = config.systemModules.host; | ||||
| 
 | ||||
|   validFunction = ["workstation" "gaming" "media-server"]; | ||||
| in | ||||
| 
 | ||||
| { | ||||
|   config = mkIf cfg.enable { | ||||
|   config = mkIf (elem host.function validFunction) { | ||||
|     hardware.pulseaudio.enable = !config.services.pipewire.enable; | ||||
|     security.rtkit.enable = config.services.pipewire.enable; | ||||
|     services.pipewire =  | ||||
|     let | ||||
|       quantum = 64; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue