2024-02-05 11:46:52 +01:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2022-03-01 22:19:03 +01:00
|
|
|
}:
|
2024-02-05 11:46:52 +01:00
|
|
|
with lib;
|
|
|
|
let
|
2022-03-01 22:19:03 +01:00
|
|
|
cfg = config.eboskma.sound;
|
2022-04-27 00:21:19 +02:00
|
|
|
in
|
|
|
|
{
|
2023-10-23 08:12:48 +02:00
|
|
|
options.eboskma.sound = {
|
|
|
|
enable = mkEnableOption "activate sound settings";
|
|
|
|
jack = mkEnableOption "enable JACK";
|
|
|
|
};
|
2021-11-21 19:07:12 +01:00
|
|
|
|
2022-05-03 18:17:38 +02:00
|
|
|
config = mkIf cfg.enable {
|
2021-11-21 19:07:12 +01:00
|
|
|
services = {
|
|
|
|
pipewire = {
|
|
|
|
enable = true;
|
|
|
|
pulse.enable = true;
|
2022-05-31 11:38:09 +02:00
|
|
|
alsa.enable = true;
|
2023-10-23 08:12:48 +02:00
|
|
|
jack.enable = cfg.jack;
|
2024-12-17 12:56:14 +01:00
|
|
|
wireplumber = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
configPackages = [
|
|
|
|
(pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/99-libcamera.conf" ''
|
|
|
|
wireplumber.profiles = {
|
|
|
|
main = {
|
|
|
|
monitor.v4l2 = disabled
|
|
|
|
monitor.libcamera = optional
|
|
|
|
}
|
|
|
|
}
|
|
|
|
'')
|
|
|
|
];
|
|
|
|
};
|
2021-11-21 19:07:12 +01:00
|
|
|
};
|
|
|
|
};
|
2021-12-18 16:23:14 +01:00
|
|
|
|
2022-03-09 11:11:24 +01:00
|
|
|
environment.etc = {
|
2022-11-11 11:54:21 +01:00
|
|
|
bluez_monitor = mkIf config.eboskma.bluetooth.enable {
|
2022-03-09 11:11:24 +01:00
|
|
|
target = "wireplumber/bluetooth.lua.d/50-bluez-config.lua";
|
|
|
|
text = ''
|
|
|
|
bluez_monitor.properties = {
|
|
|
|
["bluez5.enable-msbc"] = true,
|
|
|
|
["bluez5.enable-sbc-xq"] = true,
|
|
|
|
["bluez5.headset-roles"] = "[ hfp_hf hsp_hs hsp_ag hfp_ag ]",
|
|
|
|
["bluez5.codecs"] = "[ sbc sbc_xq aac ]",
|
|
|
|
["bluez5.hfphsp-backend"] = "native",
|
|
|
|
["bluez5.default.rate"] = 48000,
|
|
|
|
["bluez5.default.channels"] = 2,
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-12-18 16:23:14 +01:00
|
|
|
security.rtkit.enable = true;
|
|
|
|
|
2024-02-05 11:46:52 +01:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
pavucontrol
|
|
|
|
pipewire
|
|
|
|
];
|
2021-11-21 19:07:12 +01:00
|
|
|
|
2022-04-27 00:21:19 +02:00
|
|
|
users.extraUsers.${config.eboskma.var.mainUser}.extraGroups = [ "audio" ];
|
2021-11-21 19:07:12 +01:00
|
|
|
};
|
|
|
|
}
|