modules: hardware: move 'sound'
This commit is contained in:
parent
5f0c1f6a79
commit
dd19b9dd92
4 changed files with 4 additions and 4 deletions
|
|
@ -6,5 +6,6 @@
|
|||
./bluetooth.nix
|
||||
./ergodox.nix
|
||||
./networking.nix
|
||||
./sound.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
55
modules/hardware/sound.nix
Normal file
55
modules/hardware/sound.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.hardware.sound;
|
||||
in
|
||||
{
|
||||
options.my.hardware.sound = with lib; {
|
||||
enable = mkEnableOption "sound configuration";
|
||||
|
||||
pipewire = {
|
||||
enable = mkEnableOption "pipewire configuration";
|
||||
};
|
||||
|
||||
pulse = {
|
||||
enable = mkEnableOption "pulseaudio configuration";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||
# Basic configuration
|
||||
{
|
||||
sound.enable = true;
|
||||
}
|
||||
|
||||
(lib.mkIf cfg.pipewire.enable {
|
||||
# RealtimeKit is recommended
|
||||
security.rtkit.enable = true;
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
|
||||
alsa = {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
};
|
||||
|
||||
pulse = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
jack = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
media-session = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
# Pulseaudio setup
|
||||
(lib.mkIf cfg.pulse.enable {
|
||||
hardware.pulseaudio.enable = true;
|
||||
})
|
||||
]);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue