mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 09:54:40 +02:00
hardware/sound: modularize
This commit is contained in:
parent
dcb997cdf7
commit
3534ccfe76
4 changed files with 39 additions and 22 deletions
|
@ -4,5 +4,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./nitrokey
|
./nitrokey
|
||||||
|
./sound
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
37
modules/hardware/sound/default.nix
Normal file
37
modules/hardware/sound/default.nix
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.hardware.sound;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.hardware.sound = {
|
||||||
|
enable = lib.mkEnableOption "sound configuration with pipewire";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
# RealtimeKit is recommended
|
||||||
|
security.rtkit.enable = true;
|
||||||
|
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
alsa = {
|
||||||
|
enable = true;
|
||||||
|
support32Bit = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
pulse.enable = true;
|
||||||
|
|
||||||
|
jack.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.noisetorch.enable = true;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
noisetorch
|
||||||
|
pavucontrol
|
||||||
|
playerctl
|
||||||
|
pulseaudio # provide pactl to enable keyboard shortcuts
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,22 +0,0 @@
|
||||||
{ config, pkgs, ... }:
|
|
||||||
{
|
|
||||||
sound.enable = true;
|
|
||||||
|
|
||||||
hardware.pulseaudio.enable = false;
|
|
||||||
security.rtkit.enable = true;
|
|
||||||
services.pipewire = {
|
|
||||||
enable = true;
|
|
||||||
alsa.enable = true;
|
|
||||||
alsa.support32Bit = true;
|
|
||||||
pulse.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# programs.noisetorch.enable = true;
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
# noisetorch
|
|
||||||
pavucontrol
|
|
||||||
playerctl
|
|
||||||
pulseaudio # provide pactl to enable keyboard shortcuts
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -8,5 +8,6 @@
|
||||||
|
|
||||||
my.hardware = {
|
my.hardware = {
|
||||||
nitrokey.enable = true;
|
nitrokey.enable = true;
|
||||||
|
sound.enable = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue