From 824d97dc88e99fff10710e2f486e7a469c648329 Mon Sep 17 00:00:00 2001 From: Aditya Date: Wed, 10 Apr 2024 23:33:35 +0530 Subject: [PATCH] add sound --- hosts/default/configuration.nix | 13 ------------- modules/nixos/default.nix | 1 + modules/nixos/sound/default.nix | 20 ++++++++++++++++++++ 3 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 modules/nixos/sound/default.nix diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix index 838b570..dd0d1ee 100644 --- a/hosts/default/configuration.nix +++ b/hosts/default/configuration.nix @@ -62,19 +62,6 @@ services.printing.enable = true; # 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; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - - #media-session.enable = true; - }; # Enable touchpad support (enabled default in most desktopManager). # services.xserver.libinput.enable = true; diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 742ad22..7ce3811 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -9,5 +9,6 @@ ./kernel ./locale ./networking + ./sound ]; } diff --git a/modules/nixos/sound/default.nix b/modules/nixos/sound/default.nix new file mode 100644 index 0000000..39de03b --- /dev/null +++ b/modules/nixos/sound/default.nix @@ -0,0 +1,20 @@ +{ + config, + lib, + ... +}: { + options = { + sound.enable = lib.mkEnableOption "enable sound"; + }; + config = lib.mkIf config.sound.enable { + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + }; +}