mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2025-11-08 19:46:10 +01:00
purism/librem/5r4: update renamed pulseaudio option
This commit is contained in:
parent
4f90da509b
commit
ba37846397
1 changed files with 40 additions and 17 deletions
|
|
@ -1,18 +1,41 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config
|
||||||
{
|
, lib
|
||||||
config = lib.mkIf config.hardware.librem5.audio {
|
, pkgs
|
||||||
assertions = [{
|
, ...
|
||||||
assertion = config.hardware.pulseaudio.enable;
|
}: {
|
||||||
message = "Call audio on Librem5 requires pulse audio to be enabled through `hardware.pulseaudio.enable`.";
|
config =
|
||||||
}];
|
lib.mkIf config.hardware.librem5.audio
|
||||||
hardware.pulseaudio = {
|
{
|
||||||
enable = true;
|
services.dbus.packages = [ pkgs.callaudiod ];
|
||||||
# this is required to correctly configure the modem as PA source/sink
|
}
|
||||||
extraConfig = ''
|
// (
|
||||||
.include ${config.hardware.librem5.package}/etc/pulse/librem5.pa
|
let
|
||||||
'';
|
paConfig = {
|
||||||
};
|
enable = true;
|
||||||
|
# this is required to correctly configure the modem as PA source/sink
|
||||||
services.dbus.packages = [ pkgs.callaudiod ];
|
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;
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue