From 01f1576b8a4ebe7565f6aa8c0579a136b22d5a99 Mon Sep 17 00:00:00 2001 From: Fabian Montero Date: Mon, 2 Dec 2024 14:23:52 -0600 Subject: [PATCH] modularize audio --- sys/modules/audio.nix | 29 ++++++++++++++++++++++++ sys/modules/default.nix | 1 + sys/platforms/posixlycorrect/default.nix | 16 +------------ 3 files changed, 31 insertions(+), 15 deletions(-) create mode 100644 sys/modules/audio.nix diff --git a/sys/modules/audio.nix b/sys/modules/audio.nix new file mode 100644 index 0000000..df248fe --- /dev/null +++ b/sys/modules/audio.nix @@ -0,0 +1,29 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.local.sys.audio; +in { + options.local.sys.audio = { + enable = mkEnableOption "audio settings"; + }; + config = mkIf cfg.enable { + security.rtkit.enable = true; + + services.pipewire = { + enable = true; + + alsa = { + enable = true; + support32Bit = true; + }; + + jack.enable = true; + pulse.enable = true; + wireplumber.enable = true; + }; + }; +} diff --git a/sys/modules/default.nix b/sys/modules/default.nix index 9f6fdcc..eed6ea4 100644 --- a/sys/modules/default.nix +++ b/sys/modules/default.nix @@ -7,5 +7,6 @@ imports = [ ./baseline.nix ./yubikey.nix + ./audio.nix ]; } diff --git a/sys/platforms/posixlycorrect/default.nix b/sys/platforms/posixlycorrect/default.nix index 2125f47..3497bd1 100644 --- a/sys/platforms/posixlycorrect/default.nix +++ b/sys/platforms/posixlycorrect/default.nix @@ -16,6 +16,7 @@ baseline.enable = true; yubikey.enable = true; + audio.enable = true; }; # Use the systemd-boot EFI boot loader. @@ -50,21 +51,6 @@ hardware.graphics.enable = true; - security.rtkit.enable = true; - - services.pipewire = { - enable = true; - - alsa = { - enable = true; - support32Bit = true; - }; - - jack.enable = true; - pulse.enable = true; - wireplumber.enable = true; - }; - users = { users.fabian = { isNormalUser = true;