huge refactor
This commit is contained in:
parent
03e5a47910
commit
1d4c8455ee
30 changed files with 972 additions and 697 deletions
71
moduler/services/sound/default.nix
Normal file
71
moduler/services/sound/default.nix
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
{ lib, config, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.features.sound = {
|
||||
enable = mkEnableOption "enable sound and bluetooth stack";
|
||||
pipewire = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Enable PipeWire audio stack.";
|
||||
};
|
||||
alsa32Bit = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Enable 32-bit ALSA support.";
|
||||
};
|
||||
pulseCompat = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Enable PulseAudio compatibility through PipeWire.";
|
||||
};
|
||||
};
|
||||
bluetooth = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Enable Bluetooth subsystem.";
|
||||
};
|
||||
powerOnBoot = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Power on Bluetooth at boot.";
|
||||
};
|
||||
disableHeadsetProfile = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Disable headset profile for Bluetooth devices.";
|
||||
};
|
||||
bluemanEnable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Enable Blueman service.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf config.features.sound.enable {
|
||||
services.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services = {
|
||||
pipewire = {
|
||||
enable = config.features.sound.pipewire.enable;
|
||||
alsa.enable = config.features.sound.pipewire.enable;
|
||||
alsa.support32Bit = config.features.sound.pipewire.alsa32Bit;
|
||||
pulse.enable = config.features.sound.pipewire.pulseCompat;
|
||||
};
|
||||
blueman.enable = config.features.sound.bluetooth.bluemanEnable;
|
||||
};
|
||||
hardware = {
|
||||
bluetooth = mkIf config.features.sound.bluetooth.enable {
|
||||
enable = config.features.sound.bluetooth.enable;
|
||||
powerOnBoot = config.features.sound.bluetooth.powerOnBoot;
|
||||
settings = {
|
||||
General = mkIf config.features.sound.bluetooth.disableHeadsetProfile {
|
||||
Disable = "Headset";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue