From 3acdcd8d53d1421ad9d7e6bb12adaa73b1d73447 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Mon, 19 Aug 2024 11:03:55 -0400 Subject: [PATCH] hiding sound stuff --- hosts/fwbook.nix | 3 +++ modules/nixos/common/hardware/sound.nix | 33 +++++++++++++++++-------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/hosts/fwbook.nix b/hosts/fwbook.nix index 5400f31..e290f1a 100644 --- a/hosts/fwbook.nix +++ b/hosts/fwbook.nix @@ -6,11 +6,14 @@ let in { imports = [ ./fwbook.hardware-configuration.nix ]; + # Skyg skyg.user.enabled = true; skyg.nixos.desktop = { enabled = true; kde.enabled = true; }; + skyg.nixos.common.hardware.sound.enable = true; + # Firmware updater services.fwupd.enable = true; services.fwupd.package = (import (builtins.fetchTarball { diff --git a/modules/nixos/common/hardware/sound.nix b/modules/nixos/common/hardware/sound.nix index c2a336b..a791d1b 100644 --- a/modules/nixos/common/hardware/sound.nix +++ b/modules/nixos/common/hardware/sound.nix @@ -1,12 +1,25 @@ -{ ... }: { - # Enable sound with pipewire. - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; +{ lib +, config +, ... +}: +let + cfg = config.skyg.nixos.common.hardware.sound; +in +{ + options.skyg.nixos.common.hardware.sound = with lib; { + enable = mkEnableOption "sound"; + }; + + config = lib.mkIf cfg.enable { + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; }; }