mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2025-01-01 00:12:39 +03:00
nixos/pulseaudio: Add extraModules config option
This commit is contained in:
parent
613d3bac86
commit
78c0e1aa11
@ -154,6 +154,18 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraModules = mkOption {
|
||||||
|
type = types.listOf types.package;
|
||||||
|
default = [];
|
||||||
|
example = literalExample "[ pkgs.pulseaudio-modules-bt ]";
|
||||||
|
description = ''
|
||||||
|
Extra pulseaudio modules to use. This is intended for out-of-tree
|
||||||
|
pulseaudio modules like extra bluetooth codecs.
|
||||||
|
|
||||||
|
Extra modules take precedence over built-in pulseaudio modules.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
daemon = {
|
daemon = {
|
||||||
logLevel = mkOption {
|
logLevel = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
@ -236,6 +248,18 @@ in {
|
|||||||
systemd.packages = [ overriddenPackage ];
|
systemd.packages = [ overriddenPackage ];
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(mkIf (cfg.extraModules != []) {
|
||||||
|
hardware.pulseaudio.daemon.config.dl-search-path = let
|
||||||
|
overriddenModules = builtins.map
|
||||||
|
(drv: drv.override { pulseaudio = overriddenPackage; })
|
||||||
|
cfg.extraModules;
|
||||||
|
modulePaths = builtins.map
|
||||||
|
(drv: "${drv}/lib/pulse-${overriddenPackage.version}/modules")
|
||||||
|
# User-provided extra modules take precedence
|
||||||
|
(overriddenModules ++ [ overriddenPackage ]);
|
||||||
|
in lib.concatStringsSep ":" modulePaths;
|
||||||
|
})
|
||||||
|
|
||||||
(mkIf hasZeroconf {
|
(mkIf hasZeroconf {
|
||||||
services.avahi.enable = true;
|
services.avahi.enable = true;
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user