purism librem5r4: add configuration option for audio
This commit is contained in:
parent
3284d0605c
commit
793de77d9f
18
purism/librem/5r4/audio.nix
Normal file
18
purism/librem/5r4/audio.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ 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 ${pkgs.librem5-base}/etc/pulse/librem5.pa
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
services.dbus.packages = [ pkgs.callaudiod ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -15,10 +15,25 @@ in {
|
||||||
customInitrdModules = lib.mkEnableOption (lib.mdDoc "use of custom kernel modules in the initrd.");
|
customInitrdModules = lib.mkEnableOption (lib.mdDoc "use of custom kernel modules in the initrd.");
|
||||||
installUdevPackages = lib.mkEnableOption (lib.mdDoc "installation of udev packages from librem5-base.");
|
installUdevPackages = lib.mkEnableOption (lib.mdDoc "installation of udev packages from librem5-base.");
|
||||||
lockdownFix = lib.mkEnableOption (lib.mdDoc "fix for orientation and proximity sensors not working after lockdown.");
|
lockdownFix = lib.mkEnableOption (lib.mdDoc "fix for orientation and proximity sensors not working after lockdown.");
|
||||||
|
audio = lib.mkOption {
|
||||||
|
description = lib.mdDoc ''
|
||||||
|
Whether to enable and configure PulseAudio for the Librem5 modem.
|
||||||
|
|
||||||
|
This is required for audio during calls to work at all.
|
||||||
|
'';
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
example = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
imports = [ ./initrd.nix ./wifi.nix ./lockdown-fix.nix ];
|
imports = [
|
||||||
|
./audio.nix
|
||||||
|
./initrd.nix
|
||||||
|
./wifi.nix
|
||||||
|
./lockdown-fix.nix
|
||||||
|
];
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
hardware.librem5 = {
|
hardware.librem5 = {
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
{ stdenv, fetchFromGitLab, shellcheck, kmod, lib }:
|
{ stdenv, fetchFromGitLab, shellcheck, kmod, lib }:
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
pname = "librem5-udev-rules";
|
pname = "librem5-base";
|
||||||
version = "unstable";
|
version = "unstable";
|
||||||
src = fetchFromGitLab {
|
src = fetchFromGitLab {
|
||||||
domain = "source.puri.sm";
|
domain = "source.puri.sm";
|
||||||
owner = "Librem5";
|
owner = "Librem5";
|
||||||
repo = "librem5-base";
|
repo = "librem5-base";
|
||||||
rev = "f5b51beb144f76ef3bc483b74e19867bd6364d32";
|
rev = "96b0f920cde9157332b0c16ba1135ee60a3f3259";
|
||||||
hash = "sha256-5k7e4o9ak0zik+XqRV6PPwkTDf3yH3NxtLkhTyCQj7U=";
|
hash = "sha256-nR42dk3g0/IkVFygZ7K1SZ2KoQJeDzuMOumKdOOQS5k=";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildPhase = ":";
|
buildPhase = ":";
|
||||||
|
@ -27,6 +27,11 @@ stdenv.mkDerivation {
|
||||||
cp -v "$rule" "$out/lib/udev/rules.d/''${rule#*.}.rules"
|
cp -v "$rule" "$out/lib/udev/rules.d/''${rule#*.}.rules"
|
||||||
done
|
done
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
mkdir -p "$out/etc/pulse"
|
||||||
|
cp -v "default/audio/pulse/librem5.pa" "$out/etc/pulse/librem5.pa"
|
||||||
|
substituteInPlace "$out/etc/pulse/librem5.pa" \
|
||||||
|
--replace ".include /etc/pulse/default.pa" ""
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
|
|
Loading…
Reference in a new issue