From 4e1174d60820b7da07c235188a5762223a640c96 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Wed, 19 Feb 2020 06:28:39 +0800 Subject: [PATCH] adjust audio setup --- modules/system/audio.nix | 41 ++++++++++--------- system/desktop/default.nix | 2 +- system/desktop/home-manager/xmonad.nix | 3 ++ system/desktop/home-manager/xmonad/Main.hs | 6 +-- .../home-manager/xmonad/NixCommands.hs | 3 ++ 5 files changed, 31 insertions(+), 24 deletions(-) diff --git a/modules/system/audio.nix b/modules/system/audio.nix index 6fd5a4e..e1e0a6a 100644 --- a/modules/system/audio.nix +++ b/modules/system/audio.nix @@ -55,15 +55,15 @@ in { # add virtual midi module # ----------------------- - boot = { - # to route midi signals - # between bitwig and vcvrack - kernelModules = [ "snd_virmidi" ]; - # index=-2 prevents from beeing recognised as the default - # audio device - # midi_devs limit the number of midi devices. - extraModprobeConfig = "options snd-virmidi index=-2 midi_devs=1"; - }; + #boot = { + # # to route midi signals + # # between bitwig and vcvrack + # kernelModules = [ "snd_virmidi" ]; + # # index=-2 prevents from beeing recognised as the default + # # audio device + # # midi_devs limit the number of midi devices. + # extraModprobeConfig = "options snd-virmidi index=-2 midi_devs=1"; + #}; # LADSPA # ------ @@ -88,12 +88,11 @@ in { hardware.pulseaudio = { enable = true; + package = pkgs.pulseaudioFull; # all in audio group can do audio systemWide = true; - package = pkgs.pulseaudioFull; - extraConfig = '' # automatically switch to newly-connected devices @@ -112,8 +111,10 @@ in { sinkDescription = "sink_properties=device.description=${ sinkName index }-${queua.label}"; - masterValue = - if (index == 0) then "" else "master=${sinkName (index - 1)}"; + masterValue = if (index == 0) then + "" + else + "sink_master=${sinkName (index - 1)}"; pluginValue = "plugin=${ladspaPath}/${queua.plugin}"; labelValue = "label=${queua.label}"; controlValue = "control=${ @@ -133,15 +134,15 @@ in { # --------------- environment.systemPackages = with pkgs; [ - jackScript - # Music making - jack2Full - alsaUtils - patchage - zynaddsubfx + # ------------ + #jackScript + #jack2Full + #patchage + #zynaddsubfx + #qjackctl - # qjackctl + alsaUtils # LADSPA # ------ diff --git a/system/desktop/default.nix b/system/desktop/default.nix index 52a8455..63bd953 100644 --- a/system/desktop/default.nix +++ b/system/desktop/default.nix @@ -49,7 +49,7 @@ services.urxvtd.enable = true; - system.custom = { bluetooth.enable = true; }; + system.custom = { bluetooth.enable = false; }; # temperature / power consumption # https://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html diff --git a/system/desktop/home-manager/xmonad.nix b/system/desktop/home-manager/xmonad.nix index 1215f51..1846099 100644 --- a/system/desktop/home-manager/xmonad.nix +++ b/system/desktop/home-manager/xmonad.nix @@ -28,6 +28,9 @@ let nixStartCopyq = "${pkgs.copyq}/bin/copyq" nixShowCopyq = "${pkgs.copyq}/bin/copyq show" nixStartTerminal = "${pkgs.rxvt_unicode_with-plugins}/bin/urxvtc" + nixAlsaRaiseVolume = "${pkgs.alsaUtils}/bin/amixer set Master 5%+" + nixAlsaLowerVolume = "${pkgs.alsaUtils}/bin/amixer set Master 5%-" + nixAlsaMute = "${pkgs.alsaUtils}/bin/amixer set Master toggle" ''; in { diff --git a/system/desktop/home-manager/xmonad/Main.hs b/system/desktop/home-manager/xmonad/Main.hs index f6d5ced..92ed612 100644 --- a/system/desktop/home-manager/xmonad/Main.hs +++ b/system/desktop/home-manager/xmonad/Main.hs @@ -330,9 +330,9 @@ myAdditionaKeys -- Volume Control -- -- ------------------------------------------------------------ - [ ("", spawn "amixer set Master 5%+") - , ("", spawn "amixer set Master 5%-") - , ("", spawn "amixer set Master toggle") + [ ("", spawn nixAlsaRaiseVolume) + , ("", spawn nixAlsaLowerVolume) + , ("", spawn nixAlsaMute) ] ++ -- ------------------------------------------------------------ -- diff --git a/system/desktop/home-manager/xmonad/NixCommands.hs b/system/desktop/home-manager/xmonad/NixCommands.hs index 44692ed..3a32047 100644 --- a/system/desktop/home-manager/xmonad/NixCommands.hs +++ b/system/desktop/home-manager/xmonad/NixCommands.hs @@ -14,3 +14,6 @@ nixStartAlbert = "" nixStartCopyq = "" nixShowCopyq = "" nixStartTerminal = "" +nixAlsaRaiseVolume = "" +nixAlsaLowerVolume = "" +nixAlsaMute = ""