From d444b47af8b9132963fd7feaff173333c212a903 Mon Sep 17 00:00:00 2001 From: smayzy Date: Sun, 6 Jul 2025 19:00:37 +0200 Subject: [PATCH] audio toogle --- hosts/common/common.nix | 2 ++ modules/nix/pipewire.nix | 25 ++++++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/hosts/common/common.nix b/hosts/common/common.nix index 21c8617..ffa38c5 100644 --- a/hosts/common/common.nix +++ b/hosts/common/common.nix @@ -19,6 +19,8 @@ smayzy.nvf.enable = true; + smayzy.audio.enable = true; + users.users.smayzy = { isNormalUser = true; description = "smayzy"; diff --git a/modules/nix/pipewire.nix b/modules/nix/pipewire.nix index 43cf751..9e71fd5 100644 --- a/modules/nix/pipewire.nix +++ b/modules/nix/pipewire.nix @@ -1,11 +1,22 @@ { config, lib, pkgs, ... }: +let + inherit (lib) mkIf mkOption types; +in { - services.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; + options.smayzy.audio.enable = mkOption { + type = types.bool; + default = false; + description = "audio settings"; + }; + + config = mkIf config.smayzy.audio.enable { + services.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; }; }