Files
nix/modules/nih/sound.nix
Gustavo "Guz" L. de Mello 5ce99497d7 refactor!: I went too close into the sun
Simlified everything, things were getting out of control
2024-04-08 16:37:29 -03:00

39 lines
820 B
Nix

{
config,
lib,
pkgs,
...
}: let
cfg = config.nih.sound;
in {
imports = [];
options.nih.sound = with lib;
with lib.types; {
enable = mkOption {
type = bool;
default = true;
};
pipewire.enable = mkOption {
type = bool;
default = true;
};
pulseaudio.enable = mkOption {
type = bool;
default = !cfg.pipewire.enable;
};
};
config = with lib;
mkIf cfg.enable {
sound.enable = true;
hardware.pulseaudio.enable = cfg.pulseaudio.enable;
security.rtkit.enable = true;
services.pipewire = mkIf cfg.pipewire.enable {
enable = true;
alsa.enable = mkDefault true;
alsa.support32Bit = mkDefault true;
pulse.enable = mkDefault true;
wireplumber.enable = mkDefault true;
};
};
}