59 lines
1.6 KiB
Nix
59 lines
1.6 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
cfg = config.c3d2.audioStreaming;
|
|
in
|
|
{
|
|
options = {
|
|
c3d2.audioStreaming = lib.mkEnableOption "enable all services requires to audio stream to dacbert, glotzert or pulsebert";
|
|
};
|
|
|
|
config = lib.mkIf cfg {
|
|
environment.etc = lib.optionalAttrs (lib.versionAtLeast "23.05" lib.version) {
|
|
"pipewire/pipewire.conf.d/zeroconf.conf".text = builtins.toJSON {
|
|
"context.modules" = [ {
|
|
"name" = "libpipewire-module-zeroconf-discover";
|
|
} ];
|
|
};
|
|
};
|
|
|
|
environment.systemPackages = lib.mkIf config.services.xserver.enable (with pkgs; [
|
|
paprefs
|
|
pavucontrol
|
|
]);
|
|
|
|
hardware.pulseaudio.zeroconf.discovery.enable = true;
|
|
|
|
# required for paprefs to be able to save
|
|
programs.dconf.enable = lib.mkIf config.services.xserver.enable true;
|
|
|
|
security.rtkit.enable = true;
|
|
|
|
services = {
|
|
avahi = {
|
|
enable = true;
|
|
nssmdns = true;
|
|
};
|
|
|
|
pipewire = lib.mkMerge [
|
|
(lib.optionalAttrs (lib.versionAtLeast "23.05" lib.version) {
|
|
config.pipewire-pulse =
|
|
let
|
|
default-pipewire-pulse = lib.importJSON (pkgs.path + "/nixos/modules/services/desktops/pipewire/daemon/pipewire-pulse.conf.json");
|
|
in
|
|
default-pipewire-pulse // {
|
|
"context.modules" = default-pipewire-pulse."context.modules" ++ [
|
|
{
|
|
"name" = "libpipewire-module-zeroconf-discover";
|
|
}
|
|
];
|
|
};
|
|
})
|
|
{
|
|
pulse.enable = true;
|
|
}
|
|
];
|
|
};
|
|
};
|
|
}
|