Browse Source

pulsebert: make audio work

container/radius
Stefan Majewsky 1 year ago
parent
commit
bd2d0ac3d9
1 changed files with 17 additions and 1 deletions
  1. 17
    1
      nix/pulsebert/configuration.nix

+ 17
- 1
nix/pulsebert/configuration.nix View File

@@ -39,6 +39,7 @@
39 39
     splix
40 40
     # utilities
41 41
     nix-index
42
+    usbutils
42 43
     tmux
43 44
     vim
44 45
   ];
@@ -54,7 +55,9 @@
54 55
   services.openssh.enable = true;
55 56
 
56 57
   # Open ports in the firewall.
57
-  # networking.firewall.allowedTCPPorts = [ ... ];
58
+  networking.firewall.allowedTCPPorts = [
59
+    4713 # PulseAudio
60
+  ];
58 61
   # networking.firewall.allowedUDPPorts = [ ... ];
59 62
   # Or disable the firewall altogether.
60 63
   # networking.firewall.enable = false;
@@ -65,6 +68,18 @@
65 68
   # Enable sound.
66 69
   sound.enable = true;
67 70
   hardware.pulseaudio.enable = true;
71
+  # PulseAudio as-a-Service
72
+  hardware.pulseaudio.systemWide = true;
73
+  hardware.pulseaudio.tcp.anonymousClients.allowedIpRanges = [ "172.22.99.0/24" "127.0.0.0/8" "::1/128" ];
74
+  hardware.pulseaudio.tcp.enable = true;
75
+  hardware.pulseaudio.zeroconf.publish.enable = true;
76
+
77
+  # tell Avahi to publish CUPS and PulseAudio
78
+  services.avahi = {
79
+    enable = true;
80
+    publish.enable = true;
81
+    publish.userServices = true;
82
+  };
68 83
 
69 84
   # Enable the X11 windowing system.
70 85
   # services.xserver.enable = true;
@@ -80,6 +95,7 @@
80 95
 
81 96
   # Define a user account. Don't forget to set a password with ‘passwd’.
82 97
   users.users."k-ot" = {
98
+    extraGroups = ["audio"]; # allow k-ot to use PulseAudio
83 99
     isNormalUser = true;
84 100
     uid = 1000;
85 101
   };

Loading…
Cancel
Save