modularize audio

This commit is contained in:
Fabian Montero 2024-12-02 14:23:52 -06:00
parent 1221aaf0fc
commit 01f1576b8a
Signed by: fabian
GPG key ID: 1FFAC35E1798174F
3 changed files with 31 additions and 15 deletions

29
sys/modules/audio.nix Normal file
View file

@ -0,0 +1,29 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.local.sys.audio;
in {
options.local.sys.audio = {
enable = mkEnableOption "audio settings";
};
config = mkIf cfg.enable {
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
jack.enable = true;
pulse.enable = true;
wireplumber.enable = true;
};
};
}

View file

@ -7,5 +7,6 @@
imports = [
./baseline.nix
./yubikey.nix
./audio.nix
];
}

View file

@ -16,6 +16,7 @@
baseline.enable = true;
yubikey.enable = true;
audio.enable = true;
};
# Use the systemd-boot EFI boot loader.
@ -50,21 +51,6 @@
hardware.graphics.enable = true;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
jack.enable = true;
pulse.enable = true;
wireplumber.enable = true;
};
users = {
users.fabian = {
isNormalUser = true;