1
0
forked from c3d2/nix-config

Move audio specific settings from pulsebert to audioserver

This commit is contained in:
Sandro - 2023-04-29 23:05:39 +02:00
parent 9b70709d50
commit a23f73e88b
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
2 changed files with 76 additions and 64 deletions

View File

@ -66,12 +66,9 @@
domain = "hq.c3d2.de";
firewall = {
allowedTCPPorts = [
80 # ledfx
4713 # pulseaudio/pipewire network sync
5355 # llmnr
];
allowedUDPPorts = [
5353 # mdns
5355 # llmnr
];
};
@ -80,14 +77,6 @@
interfaces.eth0.useDHCP = true;
};
environment.systemPackages = with pkgs; [
mpd
mpv
ncmpcpp
ncpamixer
pulseaudio # required for pactl
];
# https://github.com/dump-dvb/nix-config/blob/310ceedca5ab2d5c22070bd73c603926b6100a74/hardware/configuration-rpi-3b.nix#L16
sdImage = lib.mkForce {
populateFirmwareCommands =
@ -144,25 +133,17 @@
'';
};
security = {
rtkit.enable = true;
sudo = {
security.sudo = {
enable = true;
wheelNeedsPassword = false;
};
};
services = {
avahi.nssmdns = true;
# Do not log to flash but also breaks journalctl --user
# journald.extraConfig = ''
# Storage=volatile
# '';
openssh = {
enable = true;
};
nginx = {
enable = true;
virtualHosts = {

View File

@ -6,8 +6,16 @@
};
config = lib.mkIf config.c3d2.audioServer.enable {
sound.enable = true;
hardware.bluetooth = {
environment.systemPackages = with pkgs; [
mpd
mpv
ncmpcpp
ncpamixer
pulseaudio # required for pactl
];
hardware = {
bluetooth = {
enable = lib.mkDefault true;
settings = {
Policy.AutoEnable = true;
@ -15,7 +23,7 @@
};
};
hardware.pulseaudio = {
pulseaudio = {
enable = !config.services.pipewire.pulse.enable;
systemWide = true;
tcp = {
@ -40,6 +48,19 @@
doCheck = false;
});
};
};
networking.firewall = {
allowedTCPPorts = [
80 # ledfx
4713 # pulseaudio/pipewire network sync
];
allowedUDPPorts = [
5353 # mdns
];
};
security.rtkit.enable = true;
services.pipewire = {
enable = true;
@ -74,11 +95,10 @@
pulse.enable = true;
};
security.rtkit.enable = true;
# tell Avahi to publish services like Pipewire/PulseAudio
services.avahi = {
enable = true;
nssmdns = true;
publish = {
enable = true;
addresses = true;
@ -86,6 +106,8 @@
};
};
sound.enable = true;
system.activationScripts.enableLingering = lib.optionalString config.services.pipewire.pulse.enable (''
rm -r /var/lib/systemd/linger
mkdir /var/lib/systemd/linger
@ -93,7 +115,8 @@
touch /var/lib/systemd/linger/k-ot
'');
systemd.services.bluetooth-agent = lib.mkIf config.hardware.bluetooth.enable {
systemd = {
services.bluetooth-agent = lib.mkIf config.hardware.bluetooth.enable {
description = "Allow anyone to pair via Bluetooth";
wantedBy = [ "multi-user.target" ];
requires = [ "bluetooth.target" ];
@ -105,6 +128,14 @@
RestartSec = 60;
};
};
user.services.ledfx = {
after = [ "pipewire.target" ];
wantedBy = [ "default.target" ];
serviceConfig = {
ExecStart = "${pkgs.ledfx}/bin/ledfx";
};
};
};
users = {
groups.pulse-access = { };