Skip to content

Commit

Permalink
pulseaudio nixos module: use the units provided by upstream (#21633)
Browse files Browse the repository at this point in the history
I have left in 2 NixOS custom config directives, so the configuration
should be the same with the only change in behaviour being that the
service is not eagerly loaded but in fact only socket activated, which
it should be.
  • Loading branch information
Peter Hoeg authored and fpletz committed Jan 9, 2017
1 parent 87e1c49 commit f1b8c3b
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions nixos/modules/config/pulseaudio.nix
Expand Up @@ -212,6 +212,7 @@ in {
# Allow PulseAudio to get realtime priority using rtkit.
security.rtkit.enable = true;

systemd.packages = [ cfg.package ];
})

(mkIf hasZeroconf {
Expand All @@ -227,31 +228,14 @@ in {
target = "pulse/default.pa";
source = myConfigFile;
};

systemd.user = {
services.pulseaudio = {
description = "PulseAudio Server";
# NixOS doesn't support "Also" so we bring it in manually
wantedBy = [ "default.target" ];
serviceConfig = {
Type = "notify";
ExecStart = binaryNoDaemon;
Restart = "on-failure";
RestartSec = "500ms";
};
environment = { DISPLAY = ":${toString config.services.xserver.display}"; };
restartIfChanged = true;
};

sockets.pulseaudio = {
description = "PulseAudio Socket";
wantedBy = [ "sockets.target" ];
socketConfig = {
Priority = 6;
Backlog = 5;
ListenStream = "%t/pulse/native";
};
};
};
})

Expand Down

0 comments on commit f1b8c3b

Please sign in to comment.