diff --git a/system/hardware/sound.nix b/system/hardware/sound.nix index 1e8b92f..d3aa0b2 100644 --- a/system/hardware/sound.nix +++ b/system/hardware/sound.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ...}: +{ config, lib, pkgs, inputs, ...}: let cfg = config.nixfiles.hardware.sound; inherit (lib) optionals mkEnableOption mkIf mkDefault; @@ -10,9 +10,15 @@ in options.nixfiles.hardware.sound = { enable = mkEnableOption "sound configuration"; + useUnstableUcmConf = lib.mkOption { + description = "Whether to enable unstable alsa-ucm-conf. This seems to cause a mass rebuild and requires a lot of packages to be built from source, so it should only be used if necessary."; + default = false; + example = true; + type = lib.types.bool; + }; }; - config = mkIf cfg.enable { + config = lib.mkMerge [(mkIf cfg.enable { security.rtkit.enable = mkDefault true; services.pipewire = { enable = true; @@ -30,5 +36,12 @@ in ncpamixer pulsemixer ]; - }; + }) + ({ + # use alsa-ucm-conf from unstable (fixes Scarlett Solo channels) + nixpkgs.overlays = lib.optional cfg.useUnstableUcmConf (final: prev: { + inherit (inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}) alsa-ucm-conf; + }); + }) + ]; }