zaphyra's git: nixfiles

zaphyra's nixfiles

commit e9a0d02c57d664946adb4ee043960fe6bfb4e630
parent 66f9a4d69043db61c237c82ee9069dc5855b26c9
Author: Katja Ramona Sophie Kwast (zaphyra) <git@zaphyra.eu>
Date: Wed, 27 Aug 2025 17:14:20 +0200

config/home-manager/zaphyra/programs: add `pipewire` specific-stuff
3 files changed, 67 insertions(+), 1 deletion(-)
A
config/home-manager/zaphyra/programs/pipewire.nix
|
62
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
M
config/nixos/modules/users/zaphyra.nix
|
2
++
M
hosts/huntii/default.nix
|
4
+++-
diff --git a/config/home-manager/zaphyra/programs/pipewire.nix b/config/home-manager/zaphyra/programs/pipewire.nix
@@ -0,0 +1,62 @@
+{
+  config,
+  lib,
+  pkgs,
+  ...
+}:
+
+{
+
+  home.packages = with pkgs; [
+    pwvucontrol
+    sonusmix
+  ];
+
+  home.file."${config.xdg.configHome}/pipewire/pipewire.conf.d/10-chloe-raop.conf".text =
+    let
+      raopSink = ipAddr: name: {
+        name = "libpipewire-module-raop-sink";
+        args = {
+          "raop.ip" = ipAddr;
+          "raop.port" = 7000;
+          "raop.name" = name;
+          "raop.encryption.type" = "auth_setup";
+        };
+      };
+
+    in
+    builtins.toJSON {
+      "context.modules" = [
+        { name = "libpipewire-module-zeroconf-discover"; }
+        {
+          name = "libpipewire-module-raop-discover";
+          args."roap.discover-local" = true;
+        }
+        (raopSink "192.168.2.63" "Living Room")
+        (raopSink "192.168.2.57" "Bed Room")
+        (raopSink "192.168.2.54" "Datacenter")
+        (raopSink "192.168.2.80" "Kitchen")
+        {
+          name = "libpipewire-module-combine-stream";
+          args = {
+            "node.name" = "combine_sink";
+            "node.description" = "Multi-Room";
+            "combine.mode" = "sink";
+            "combine.latency-compensate" = false;
+            "stream.rules" = [
+              {
+                actions."create-stream" = { };
+                matches = [
+                  {
+                    "media.class" = "Audio/Sink";
+                    "node.name" = "~raop_sink.*";
+                  }
+                ];
+              }
+            ];
+          };
+        }
+      ];
+    };
+
+}
diff --git a/config/nixos/modules/users/zaphyra.nix b/config/nixos/modules/users/zaphyra.nix
@@ -78,6 +78,8 @@ in
               programs.bitwarden-cli
               programs.chaosctl
 
+              programs.pipewire
+
               programs.firefox
               programs.thunderbird
 
diff --git a/hosts/huntii/default.nix b/hosts/huntii/default.nix
@@ -118,7 +118,8 @@
         ];
         #required for owntone airplay foo
         firewall.allowedUDPPorts = [
-          7200 7201
+          7200
+          7201
         ];
       };
 

@@ -136,6 +137,7 @@
           publish.userServices = true;
         };
         gnome.at-spi2-core.enable = false;
+        pipewire.raopOpenFirewall = true;
       };
 
       system.stateVersion = "25.05";