pinwheel: Extract sound config into module

This commit is contained in:
Alexander Heldt
2023-08-20 21:39:15 +02:00
parent 9615a0dbe0
commit efdece03b9
2 changed files with 32 additions and 16 deletions

View File

@@ -13,6 +13,7 @@
./modules/syncthing ./modules/syncthing
./modules/firefox ./modules/firefox
./modules/light ./modules/light
./modules/sound
]; ];
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
@@ -58,23 +59,8 @@
security.polkit.enable = true; security.polkit.enable = true;
hardware.opengl.enable = true; hardware.opengl.enable = true;
programs.dconf.enable = true; programs.dconf.enable = true;
# Sound
hardware.pulseaudio.enable = false;
hardware.bluetooth.enable = true;
services.blueman.enable = true;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
wireplumber.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Configure console keymap # Configure console keymap
console.keyMap = "sv-latin1"; console.keyMap = "sv-latin1";
@@ -82,7 +68,7 @@
users.users.alex = { users.users.alex = {
isNormalUser = true; isNormalUser = true;
description = "alex"; description = "alex";
extraGroups = [ "networkmanager" "wheel" "audio" ]; extraGroups = [ "networkmanager" "wheel" ];
shell = pkgs.zsh; shell = pkgs.zsh;
packages = with pkgs; []; packages = with pkgs; [];
}; };

View File

@@ -0,0 +1,30 @@
{ home-manager, pkgs, ... }:
{
users.users.alex.extraGroups = [ "audio" ];
hardware.pulseaudio.enable = false;
hardware.bluetooth.enable = true;
services.blueman.enable = true;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
wireplumber.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
home-manager.users.alex = {
wayland.windowManager.hyprland = {
settings = {
bind = [
", XF86AudioRaiseVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 2%+"
", XF86AudioLowerVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-"
", XF86AudioMute, exec, ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
];
};
};
};
}