mass reformat
This commit is contained in:
parent
ed1c53e94c
commit
9cb456ad60
25 changed files with 1216 additions and 1043 deletions
139
modules/ezpw.nix
139
modules/ezpw.nix
|
@ -1,6 +1,11 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let cfg = config.services.ezpw;
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.services.ezpw;
|
||||
in {
|
||||
options.services.ezpw = {
|
||||
enable = mkEnableOption "Enable pipewire";
|
||||
|
@ -13,8 +18,7 @@ in {
|
|||
|
||||
usbSoundcard = mkOption {
|
||||
type = types.bool;
|
||||
description =
|
||||
"Doubles the audio rate for alsa outputs in low latency mode";
|
||||
description = "Doubles the audio rate for alsa outputs in low latency mode";
|
||||
default = false;
|
||||
};
|
||||
|
||||
|
@ -38,9 +42,10 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
config =
|
||||
let qr = "${toString cfg.quantum}/${toString cfg.rate}";
|
||||
in mkIf cfg.enable {
|
||||
config = let
|
||||
qr = "${toString cfg.quantum}/${toString cfg.rate}";
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
hardware.pulseaudio.enable = lib.mkDefault false;
|
||||
sound.enable = lib.mkDefault false;
|
||||
|
||||
|
@ -71,26 +76,26 @@ in {
|
|||
"rt.time.soft" = 200000;
|
||||
"rt.time.hard" = 200000;
|
||||
};
|
||||
flags = [ "ifexists" "nofail" ];
|
||||
flags = ["ifexists" "nofail"];
|
||||
}
|
||||
{ name = "libpipewire-module-protocol-native"; }
|
||||
{ name = "libpipewire-module-profiler"; }
|
||||
{ name = "libpipewire-module-metadata"; }
|
||||
{ name = "libpipewire-module-spa-device-factory"; }
|
||||
{ name = "libpipewire-module-spa-node-factory"; }
|
||||
{ name = "libpipewire-module-client-node"; }
|
||||
{ name = "libpipewire-module-client-device"; }
|
||||
{name = "libpipewire-module-protocol-native";}
|
||||
{name = "libpipewire-module-profiler";}
|
||||
{name = "libpipewire-module-metadata";}
|
||||
{name = "libpipewire-module-spa-device-factory";}
|
||||
{name = "libpipewire-module-spa-node-factory";}
|
||||
{name = "libpipewire-module-client-node";}
|
||||
{name = "libpipewire-module-client-device";}
|
||||
{
|
||||
name = "libpipewire-module-portal";
|
||||
flags = [ "ifexists" "nofail" ];
|
||||
flags = ["ifexists" "nofail"];
|
||||
}
|
||||
{
|
||||
name = "libpipewire-module-access";
|
||||
args = { };
|
||||
args = {};
|
||||
}
|
||||
{ name = "libpipewire-module-adapter"; }
|
||||
{ name = "libpipewire-module-link-factory"; }
|
||||
{ name = "libpipewire-module-session-manager"; }
|
||||
{name = "libpipewire-module-adapter";}
|
||||
{name = "libpipewire-module-link-factory";}
|
||||
{name = "libpipewire-module-session-manager";}
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -104,19 +109,19 @@ in {
|
|||
"rt.time.soft" = 200000;
|
||||
"rt.time.hard" = 200000;
|
||||
};
|
||||
flags = [ "ifexists" "nofail" ];
|
||||
flags = ["ifexists" "nofail"];
|
||||
}
|
||||
{ name = "libpipewire-module-protocol-native"; }
|
||||
{ name = "libpipewire-module-client-node"; }
|
||||
{ name = "libpipewire-module-adapter"; }
|
||||
{ name = "libpipewire-module-metadata"; }
|
||||
{name = "libpipewire-module-protocol-native";}
|
||||
{name = "libpipewire-module-client-node";}
|
||||
{name = "libpipewire-module-adapter";}
|
||||
{name = "libpipewire-module-metadata";}
|
||||
{
|
||||
name = "libpipewire-module-protocol-pulse";
|
||||
args = {
|
||||
"pulse.min.req" = qr;
|
||||
"pulse.default.req" = qr;
|
||||
"pulse.min.quantum" = qr;
|
||||
"server.address" = [ "unix:native" ];
|
||||
"server.address" = ["unix:native"];
|
||||
};
|
||||
}
|
||||
];
|
||||
|
@ -129,65 +134,75 @@ in {
|
|||
};
|
||||
|
||||
media-session.config.alsa-monitor = mkIf cfg.lowLatency {
|
||||
rules = [{
|
||||
matches = [{ node.name = "alsa_output.*"; }];
|
||||
actions = {
|
||||
update-props = {
|
||||
"audio.format" = "S32LE";
|
||||
"audio.rate" = cfg.rate * (if cfg.usbSoundcard then 2 else 1);
|
||||
"api.alsa.period-size" = cfg.periodSize;
|
||||
rules = [
|
||||
{
|
||||
matches = [{node.name = "alsa_output.*";}];
|
||||
actions = {
|
||||
update-props = {
|
||||
"audio.format" = "S32LE";
|
||||
"audio.rate" =
|
||||
cfg.rate
|
||||
* (
|
||||
if cfg.usbSoundcard
|
||||
then 2
|
||||
else 1
|
||||
);
|
||||
"api.alsa.period-size" = cfg.periodSize;
|
||||
};
|
||||
};
|
||||
};
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
media-session.config.bluez-monitor = {
|
||||
properties = {
|
||||
"bluez5.codecs" = [ "sbc" "aac" "ldac" "aptx" "aptx_hd" ];
|
||||
"bluez5.codecs" = ["sbc" "aac" "ldac" "aptx" "aptx_hd"];
|
||||
"bluez5.mdbc-support" = true;
|
||||
};
|
||||
rules = [
|
||||
{
|
||||
actions = {
|
||||
update-props = {
|
||||
"bluez5.auto-connect" = [ "hsp_hs" "hfp_hf" "a2dp_sink" ];
|
||||
"bluez5.hw-volume" =
|
||||
[ "hsp_ag" "hfp_ag" "a2dp_source" "a2dp_sink" ];
|
||||
"bluez5.auto-connect" = ["hsp_hs" "hfp_hf" "a2dp_sink"];
|
||||
"bluez5.hw-volume" = ["hsp_ag" "hfp_ag" "a2dp_source" "a2dp_sink"];
|
||||
"bluez5.autoswitch-profile" = true;
|
||||
};
|
||||
};
|
||||
matches = [{ "device.name" = "~bluez_card.*"; }];
|
||||
matches = [{"device.name" = "~bluez_card.*";}];
|
||||
}
|
||||
{
|
||||
actions = { update-props = { "node.pause-on-idle" = false; }; };
|
||||
actions = {update-props = {"node.pause-on-idle" = false;};};
|
||||
matches = [
|
||||
{ "node.name" = "~bluez_input.*"; }
|
||||
{ "node.name" = "~bluez_output.*"; }
|
||||
{"node.name" = "~bluez_input.*";}
|
||||
{"node.name" = "~bluez_output.*";}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs;
|
||||
[
|
||||
# pactl is required for pipewire-pulse
|
||||
pulseaudio
|
||||
];
|
||||
environment.systemPackages = with pkgs; [
|
||||
# pactl is required for pipewire-pulse
|
||||
pulseaudio
|
||||
];
|
||||
|
||||
environment.etc."wireplumber/main.lua.d/51-alsa-config.lua" =
|
||||
mkIf cfg.lowLatency {
|
||||
text = ''
|
||||
alsa_monitor.properties = {
|
||||
["audio.rate"] = ${
|
||||
toString (cfg.rate * (if cfg.usbSoundcard then 2 else 1))
|
||||
},
|
||||
["audio.format"] = "S32LE",
|
||||
["api.alsa.headroom"] = 512,
|
||||
["api.alsa.period-size"] = ${toString cfg.periodSize}
|
||||
}
|
||||
'';
|
||||
};
|
||||
environment.etc."wireplumber/main.lua.d/51-alsa-config.lua" = mkIf cfg.lowLatency {
|
||||
text = ''
|
||||
alsa_monitor.properties = {
|
||||
["audio.rate"] = ${
|
||||
toString (cfg.rate
|
||||
* (
|
||||
if cfg.usbSoundcard
|
||||
then 2
|
||||
else 1
|
||||
))
|
||||
},
|
||||
["audio.format"] = "S32LE",
|
||||
["api.alsa.headroom"] = 512,
|
||||
["api.alsa.period-size"] = ${toString cfg.periodSize}
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
environment.etc."wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = ''
|
||||
bluez_monitor.properties = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue