34 lines
		
	
	
		
			766 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			766 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
# Must be paired with the pipewire Nix module, this does nothing but install packages
 | 
						|
{
 | 
						|
  config,
 | 
						|
  lib,
 | 
						|
  pkgs,
 | 
						|
  ...
 | 
						|
}:
 | 
						|
with lib; let
 | 
						|
  cfg = config.sound.hardware.focusrite;
 | 
						|
in {
 | 
						|
  options.sound.hardware.focusrite = {
 | 
						|
    enable = mkEnableOption "Focusrite audio interface support";
 | 
						|
    guiSupport = mkOption {
 | 
						|
      type = types.bool;
 | 
						|
      default = false;
 | 
						|
      description = "Enable GUI support for Focusrite Scarlett audio interface (installs alsa-scarlett-gui)";
 | 
						|
    };
 | 
						|
  };
 | 
						|
  config = mkIf cfg.enable (mkMerge [
 | 
						|
    {
 | 
						|
      environment.systemPackages = with pkgs;
 | 
						|
        [
 | 
						|
          scarlett2
 | 
						|
          alsa-scarlett-gui
 | 
						|
        ]
 | 
						|
        ++ (
 | 
						|
          if cfg.guiSupport
 | 
						|
          then [pkgs.alsa-scarlett-gui]
 | 
						|
          else []
 | 
						|
        );
 | 
						|
    }
 | 
						|
  ]);
 | 
						|
}
 |