From a508db48c93f6751dc63dc642636fb1820860b2f Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 25 May 2021 17:59:18 +0200 Subject: [PATCH] modules: add sound I will probably want to share this configuration between multiple machines in the future. --- modules/default.nix | 1 + modules/sound.nix | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 modules/sound.nix diff --git a/modules/default.nix b/modules/default.nix index a5ffc91..32b5b6f 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -12,6 +12,7 @@ ./networking.nix ./nix.nix ./packages.nix + ./sound.nix ./upower.nix ./users.nix ]; diff --git a/modules/sound.nix b/modules/sound.nix new file mode 100644 index 0000000..5e5ca63 --- /dev/null +++ b/modules/sound.nix @@ -0,0 +1,25 @@ +{ config, lib, ... }: +let + cfg = config.my.modules.sound; +in +{ + options.my.modules.sound = with lib; { + enable = mkEnableOption "sound configuration"; + + pulse = { + enable = mkEnableOption "pulseaudio configuration"; + }; + }; + + config = lib.mkIf cfg.enable (lib.mkMerge [ + # Basic configuration + { + sound.enable = true; + } + + # Pulseaudio setup + (lib.mkIf cfg.pulse.enable { + hardware.pulseaudio.enable = true; + }) + ]); +}