sound: add option to use unstable alsa-ucm-conf

This commit is contained in:
NullBite 2024-02-11 13:11:31 +01:00
parent 189e5983cd
commit 1a06b0c70e
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -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;
});
})
];
}