mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2025-11-03 08:47:13 +08:00
purism/librem/5r4: update renamed pulseaudio option
This commit is contained in:
committed by
mergify[bot]
parent
4f90da509b
commit
ba37846397
@@ -1,18 +1,41 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config = lib.mkIf config.hardware.librem5.audio {
|
||||
assertions = [{
|
||||
assertion = config.hardware.pulseaudio.enable;
|
||||
message = "Call audio on Librem5 requires pulse audio to be enabled through `hardware.pulseaudio.enable`.";
|
||||
}];
|
||||
hardware.pulseaudio = {
|
||||
enable = true;
|
||||
# this is required to correctly configure the modem as PA source/sink
|
||||
extraConfig = ''
|
||||
.include ${config.hardware.librem5.package}/etc/pulse/librem5.pa
|
||||
'';
|
||||
};
|
||||
|
||||
services.dbus.packages = [ pkgs.callaudiod ];
|
||||
};
|
||||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}: {
|
||||
config =
|
||||
lib.mkIf config.hardware.librem5.audio
|
||||
{
|
||||
services.dbus.packages = [ pkgs.callaudiod ];
|
||||
}
|
||||
// (
|
||||
let
|
||||
paConfig = {
|
||||
enable = true;
|
||||
# this is required to correctly configure the modem as PA source/sink
|
||||
extraConfig = ''
|
||||
.include ${config.hardware.librem5.package}/etc/pulse/librem5.pa
|
||||
'';
|
||||
};
|
||||
in
|
||||
if lib.versionOlder (lib.versions.majorMinor lib.version) "25.05"
|
||||
then {
|
||||
assertions = [
|
||||
{
|
||||
assertion = config.hardware.pulseaudio.enable;
|
||||
message = "Call audio on Librem5 requires pulse audio to be enabled through `hardware.pulseaudio.enable`.";
|
||||
}
|
||||
];
|
||||
hardware.pulseaudio = paConfig;
|
||||
}
|
||||
else {
|
||||
assertions = [
|
||||
{
|
||||
assertion = config.services.pulseaudio.enable;
|
||||
message = "Call audio on Librem5 requires pulse audio to be enabled through `services.pulseaudio.enable`.";
|
||||
}
|
||||
];
|
||||
services.pulseaudio = paConfig;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user