51 lines
1.1 KiB
Nix
51 lines
1.1 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
# PipeWire as the desktop audio server.
|
|
{
|
|
options.modules.desktop.utilities.audio.enable = lib.mkEnableOption "the PipeWire audio server";
|
|
|
|
config = lib.mkIf config.modules.desktop.utilities.audio.enable {
|
|
registry.keybind.${config.networking.hostName} = {
|
|
media-play = {
|
|
keys = "XF86AudioPlay";
|
|
locked = true;
|
|
action = {
|
|
kind = "exec";
|
|
command = "${pkgs.playerctl}/bin/playerctl play-pause";
|
|
};
|
|
};
|
|
|
|
media-next = {
|
|
keys = "XF86AudioNext";
|
|
locked = true;
|
|
action = {
|
|
kind = "exec";
|
|
command = "${pkgs.playerctl}/bin/playerctl next";
|
|
};
|
|
};
|
|
|
|
media-previous = {
|
|
keys = "XF86AudioPrev";
|
|
locked = true;
|
|
action = {
|
|
kind = "exec";
|
|
command = "${pkgs.playerctl}/bin/playerctl previous";
|
|
};
|
|
};
|
|
};
|
|
|
|
# Realtime scheduling for the audio threads, so playback survives load.
|
|
security.rtkit.enable = true;
|
|
|
|
services.pipewire = {
|
|
enable = true;
|
|
alsa.enable = true;
|
|
pulse.enable = true;
|
|
};
|
|
};
|
|
}
|