system/modules/nixos/configs/sound.nix

35 lines
737 B
Nix
Raw Normal View History

2024-04-16 02:51:46 +03:00
{ config, pkgs, lib, ... }:
let
cfg = config.local.sound;
in
2024-04-16 02:51:46 +03:00
{
options.local.sound = {
enable = lib.mkEnableOption "sound";
systemWide = lib.mkEnableOption "systemWide";
};
2024-04-16 02:51:46 +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
hardware.pulseaudio = lib.mkMerge [
{
enable = true;
package = pkgs.pulseaudioFull;
2024-11-30 23:46:01 +03:00
support32Bit = true;
}
(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
};
}