From 9a25a834a6338b8f7e1279f7302589f98c8ba907 Mon Sep 17 00:00:00 2001 From: rocketcamel Date: Sun, 26 Jan 2025 00:41:42 -0800 Subject: [PATCH] feat: volume control on tux, moved wg into common --- nix/hosts/tux/configuration.nix | 3 ++- nix/modules/commonPackages.nix | 1 + nix/modules/default.nix | 1 + nix/modules/i3.nix | 8 ++++++++ nix/modules/pipewire.nix | 13 +++++++++++++ 5 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 nix/modules/pipewire.nix diff --git a/nix/hosts/tux/configuration.nix b/nix/hosts/tux/configuration.nix index b9e5fc3..cf95331 100755 --- a/nix/hosts/tux/configuration.nix +++ b/nix/hosts/tux/configuration.nix @@ -76,6 +76,8 @@ services.pipewire = { enable = true; + alsa.enable = true; + alsa.support32Bit = true; pulse.enable = true; }; @@ -95,7 +97,6 @@ config.commonPackages ++ [ dolphin - wireguard-tools ]; # Some programs need SUID wrappers, can be configured further or are diff --git a/nix/modules/commonPackages.nix b/nix/modules/commonPackages.nix index 6ecd109..4f299bc 100755 --- a/nix/modules/commonPackages.nix +++ b/nix/modules/commonPackages.nix @@ -22,6 +22,7 @@ rustup nixfmt-rfc-style asciiquarium + wireguard-tools ]; programs.nix-ld.enable = true; programs.zsh.enable = true; diff --git a/nix/modules/default.nix b/nix/modules/default.nix index 51fd84c..b2d40a8 100755 --- a/nix/modules/default.nix +++ b/nix/modules/default.nix @@ -10,5 +10,6 @@ ./hm.nix ./i3.nix ./kanata.nix + ./pipewire.nix ]; } diff --git a/nix/modules/i3.nix b/nix/modules/i3.nix index ecd0cbf..487a6ba 100755 --- a/nix/modules/i3.nix +++ b/nix/modules/i3.nix @@ -39,6 +39,14 @@ modifier = "Mod4"; defaultWorkspace = "workspace number 1"; terminal = "alacritty"; + keybindings = + let + modifier = config.xsession.windowManager.i3.config.modifier; + in + lib.mkOptionDefault { + "XF86AudioRaiseVolume" = "exec pamixer -i 5"; + "XF86AudioLowerVolume" = "exec pamixer -d 5"; + }; }; }; }; diff --git a/nix/modules/pipewire.nix b/nix/modules/pipewire.nix new file mode 100644 index 0000000..13576d3 --- /dev/null +++ b/nix/modules/pipewire.nix @@ -0,0 +1,13 @@ +{ + lib, + config, + pkgs, + ... +}: +{ + config = lib.mkIf config.services.pipewire.enable { + environment.systemPackages = with pkgs; [ + pamixer + ]; + }; +}