Skip to content

Instantly share code, notes, and snippets.

@naranyala
Created March 13, 2026 00:12
Show Gist options
  • Select an option

  • Save naranyala/e22041800b5c52aad76b38a80bc22fe0 to your computer and use it in GitHub Desktop.

Select an option

Save naranyala/e22041800b5c52aad76b38a80bc22fe0 to your computer and use it in GitHub Desktop.
{ pkgs, ... }: {
# ...another config
# 1. Enable Bluetooth with High-Fidelity Codec Support
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
# 2. Configure PipeWire (Audio Backend & Low-Latency Tuning)
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
# Low-Latency & Sampling Rate Tweaks
extraConfig.pipewire."92-low-latency" = {
"context.properties" = {
"default.clock.rate" = 48000;
"default.clock.quantum" = 512; # Balance between latency and CPU
"default.clock.min-quantum" = 32; # Minimum buffer
"default.clock.max-quantum" = 1024; # Maximum buffer
};
};
# Bluetooth Audio Quality Improvements
wireplumber.extraConfig = {
"10-bluez" = {
"monitor.bluez.properties" = {
"bluez5.enable-sbc-xq" = true;
"bluez5.enable-msbc" = true;
"bluez5.enable-hw-volume" = true;
"bluez5.roles" = [ "a2dp_sink" "a2dp_source" "headset_head_unit" "headset_audio_gateway" ];
};
};
};
};
# 3. System Packages (GUI Apps & Audio Libraries)
environment.systemPackages = with pkgs; [
# Players
spotify
# Audio Processing & EQ
easyeffects # The GUI Equalizer
lsp-plugins # Pro-grade filters for EasyEffects
rnnoise-plugin # AI-powered Noise Cancellation for Mic
# Utilities
pavucontrol # Advanced Volume Control GUI
];
# 4. Firewall for Spotify Connect & Discovery
networking.firewall = {
allowedTCPPorts = [ 57621 ]; # Spotify Discovery
allowedUDPPorts = [ 5353 ]; # mDNS for Spotify Connect
};
# ...the rest of config
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment