diff options
| author | makefu <github@syntax-fehler.de> | 2016-02-04 11:16:17 +0100 |
|---|---|---|
| committer | makefu <github@syntax-fehler.de> | 2016-02-04 11:16:17 +0100 |
| commit | a6bfdbdf6d0d29955589de57e99127c4ac8ede5e (patch) | |
| tree | 7af0effd583903bdd5d82804aa57afad1f17e2cd /tv/2configs/pulse.nix | |
| parent | db2a1da01749e876e7881641220aef56d93580ff (diff) | |
| parent | 1c6213b4cc7c0029c3ec78f03ff2ccc37c1f0278 (diff) | |
Merge 'cd/master' - update krebs.build.source
Diffstat (limited to 'tv/2configs/pulse.nix')
| -rw-r--r-- | tv/2configs/pulse.nix | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/tv/2configs/pulse.nix b/tv/2configs/pulse.nix index 3db3532..e1894ca 100644 --- a/tv/2configs/pulse.nix +++ b/tv/2configs/pulse.nix @@ -1,5 +1,6 @@ { config, lib, pkgs, ... }: +with lib; let pkg = pkgs.pulseaudioLight; runDir = "/run/pulse"; @@ -35,36 +36,43 @@ let in { - systemd.tmpfiles.rules = [ - "d ${runDir} 0750 pulse pulse - -" - "d ${runDir}/home 0700 pulse pulse - -" - ]; - - system.activationScripts.pulseaudio-hack = '' - ln -fns ${clientConf} /etc/pulse/client.conf - ''; - environment = { etc = { "asound.conf".source = alsaConf; - #"pulse/client.conf" = lib.mkForce { source = clientConf; }; + # XXX mkForce is not strong enough (and neither is mkOverride) to create + # /etc/pulse/client.conf, see pulseaudio-hack below for a solution. + #"pulse/client.conf" = mkForce { source = clientConf; }; + #"pulse/client.conf".source = mkForce clientConf; "pulse/default.pa".source = configFile; }; - systemPackages = [ pkg ]; + systemPackages = [ + pkg + ] ++ optionals config.services.xserver.enable [ + pkgs.pavucontrol + ]; }; # Allow PulseAudio to get realtime priority using rtkit. security.rtkit.enable = true; + system.activationScripts.pulseaudio-hack = '' + ln -fns ${clientConf} /etc/pulse/client.conf + ''; + systemd.services.pulse = { wantedBy = [ "sound.target" ]; before = [ "sound.target" ]; environment = { PULSE_RUNTIME_PATH = "${runDir}/home"; - #DISPLAY = ":${toString config.services.xserver.display}"; }; serviceConfig = { ExecStart = "${pkg}/bin/pulseaudio"; + ExecStartPre = pkgs.writeScript "pulse-start" '' + #! /bin/sh + install -o pulse -g pulse -m 0750 -d ${runDir} + install -o pulse -g pulse -m 0700 -d ${runDir}/home + ''; + PermissionsStartOnly = "true"; User = "pulse"; }; }; |
