system/modules/nixos/configs/sound.nix

36 lines
717 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-04-16 02:51:46 +03:00
sound = {
enable = true;
mediaKeys.enable = true;
};
hardware.pulseaudio = lib.mkMerge [
{
enable = true;
package = pkgs.pulseaudioFull;
}
(lib.mkIf cfg.systemWide {
systemWide = true;
support32Bit = 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
};
}