From 63ed764946dc5ac25de4fc81ade8afbd33e0f38d Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 8 Jul 2023 19:53:43 +0300 Subject: [PATCH] pipewire --- hosts/sakotop/configuration.nix | 21 +------------------ modules/hardware/default.nix | 1 + modules/hardware/pipewire/default.nix | 29 +++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 20 deletions(-) create mode 100644 modules/hardware/pipewire/default.nix diff --git a/hosts/sakotop/configuration.nix b/hosts/sakotop/configuration.nix index f1d3d471..3119916c 100644 --- a/hosts/sakotop/configuration.nix +++ b/hosts/sakotop/configuration.nix @@ -11,14 +11,6 @@ # required for hostname specific configurations networking.hostName = "sakotop"; # Define your hostname. - # Enable the X11 windowing system. - #services.xserver = { - # enable = true; - # # bspwm - # windowManager.bspwm.enable = true; - # layout = "us"; - #}; - modules = { desktop = { kitty.enable = true; @@ -26,6 +18,7 @@ }; hardware = { nvidia.enable = true; + pipewire.enable = true; }; shell = { nix = { @@ -52,18 +45,6 @@ # Enable CUPS to print documents. # services.printing.enable = true; - # for some reason this needs to be disabled - sound.enable = false; - # dont like pulseaudio - #hardware.pulseaudio.enable = true; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - # Enable touchpad support (enabled default in most desktopManager). services.xserver.libinput.enable = true; diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix index efa08338..472edd74 100644 --- a/modules/hardware/default.nix +++ b/modules/hardware/default.nix @@ -1,5 +1,6 @@ { imports = [ ./nvidia + ./pipewire ]; } diff --git a/modules/hardware/pipewire/default.nix b/modules/hardware/pipewire/default.nix new file mode 100644 index 00000000..cc6e0a25 --- /dev/null +++ b/modules/hardware/pipewire/default.nix @@ -0,0 +1,29 @@ +{ outputs, options, config, lib, pkgs, ...}: +with lib; +let + cfg = config.modules.hardware.pipewire; +in +{ + options.modules.hardware.pipewire = { + enable = mkEnableOption false; + }; + + config = mkIf cfg.enable { + # resolve racial conflict between + # pulseaudio and pipewire + sound.enable = false; + + # what is this for will source games + # still work what + security.rtkit.enable = true; + + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + }; +} +