about summary refs log tree commit diff
path: root/modules/sound.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2024-05-25 22:16:47 +0300
committerAzat Bahawi <azat@bahawi.net>2024-05-25 22:16:47 +0300
commit364e8a98ad25127f2a51696ec03729e3a783044f (patch)
tree1ac46553d1dca1259da539eddc7db100eaf5c137 /modules/sound.nix
parent2024-05-05 (diff)
2024-05-25
Diffstat (limited to '')
-rw-r--r--modules/sound.nix27
1 files changed, 19 insertions, 8 deletions
diff --git a/modules/sound.nix b/modules/sound.nix
index ff90dfc..49ca5bc 100644
--- a/modules/sound.nix
+++ b/modules/sound.nix
@@ -1,4 +1,9 @@
-{ config, lib, ... }:
+{
+  config,
+  lib,
+  this,
+  ...
+}:
 with lib;
 let
   cfg = config.nixfiles.modules.sound;
@@ -6,13 +11,19 @@ in
 {
   options.nixfiles.modules.sound.enable = mkEnableOption "sound support";
 
-  config = mkIf cfg.enable {
-    services.pipewire = {
-      enable = true;
+  config =
+    mkIf cfg.enable {
+      services.pipewire = {
+        enable = true;
+
+        alsa.enable = true;
+        jack.enable = true;
+        pulse.enable = true;
+      };
 
-      alsa.enable = true;
-      jack.enable = true;
-      pulse.enable = true;
+      security.rtkit.enable = true;
+    }
+    // {
+      sound.enable = this.isHeadful;
     };
-  };
 }

Consider giving Nix/NixOS a try! <3