[audio] Add an audio role

This commit is contained in:
2024-09-19 20:44:01 -07:00
parent 4d39f8a635
commit 3f1bdc7af0
6 changed files with 36 additions and 11 deletions

View File

@@ -11,6 +11,7 @@
];
roles = {
audio.enable = true;
kodi = {
enable = true;
autologin = true;

View File

@@ -10,6 +10,7 @@
];
roles = {
audio.enable = true;
bluetooth.enable = true;
desktop.enable = true;
nfs-mounts.enable = true;

View File

@@ -11,6 +11,7 @@
];
roles = {
audio.enable = true;
desktop = {
enable = true;
x11Only = true;

32
roles/audio/default.nix Normal file
View File

@@ -0,0 +1,32 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.roles.audio;
in
{
options.roles.audio = {
enable = mkEnableOption "Enable the audio role";
};
config =
{
environment.systemPackages = with pkgs; [
paprefs
pavucontrol
pulsemixer
];
services.pipewire = {
enable = true;
pulse.enable = true;
};
hardware.pulseaudio.package = pkgs.pulseaudioFull;
hardware.pulseaudio.extraConfig = "
load-module module-combine-sink
load-module module-switch-on-connect
";
};
}

View File

@@ -21,12 +21,6 @@ in
};
services.blueman.enable = true;
hardware.pulseaudio.package = pkgs.pulseaudioFull;
hardware.pulseaudio.extraConfig = "
load-module module-combine-sink
load-module module-switch-on-connect
";
};
}

View File

@@ -7,6 +7,7 @@ let
in
{
imports = [
./audio
./bluetooth
./desktop
./kodi
@@ -38,11 +39,6 @@ in
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.pipewire = {
enable = true;
pulse.enable = true;
};
environment.systemPackages = with pkgs; [
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
git