2024-04-16 02:51:46 +03:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
2024-09-27 23:13:34 +03:00
|
|
|
let
|
|
|
|
cfg = config.local.sound;
|
|
|
|
in
|
2024-04-16 02:51:46 +03:00
|
|
|
{
|
2024-09-27 23:13:34 +03:00
|
|
|
options.local.sound = {
|
|
|
|
enable = lib.mkEnableOption "sound";
|
|
|
|
systemWide = lib.mkEnableOption "systemWide";
|
|
|
|
};
|
2024-04-16 02:51:46 +03:00
|
|
|
|
2024-09-27 23:13:34 +03:00
|
|
|
config = lib.mkIf cfg.enable {
|
2024-11-30 23:46:01 +03:00
|
|
|
services.pipewire.enable = false;
|
|
|
|
|
|
|
|
environment.systemPackages = [ pkgs.alsa-utils ];
|
2024-04-16 02:51:46 +03:00
|
|
|
|
2024-09-27 23:13:34 +03:00
|
|
|
hardware.pulseaudio = lib.mkMerge [
|
|
|
|
{
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.pulseaudioFull;
|
2024-11-30 23:46:01 +03:00
|
|
|
support32Bit = true;
|
2024-09-27 23:13:34 +03:00
|
|
|
}
|
|
|
|
(lib.mkIf cfg.systemWide {
|
|
|
|
systemWide = true;
|
|
|
|
tcp = {
|
|
|
|
enable = true;
|
|
|
|
anonymousClients.allowedIpRanges = [ "127.0.0.1" ];
|
|
|
|
};
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
networking.firewall.allowedTCPPorts = lib.mkIf cfg.systemWide [ 4713 ];
|
2024-04-16 02:51:46 +03:00
|
|
|
};
|
|
|
|
}
|