anchor.diff:          description = "PulseAudio System-Wide Server";
           wantedBy = [ "sound.target" ];
           before = [ "sound.target" ];
  -        path = [ cfg.package ];
  -        environment.PULSE_RUNTIME_PATH = pulseRuntimePath;
  +        environment.PULSE_RUNTIME_PATH = stateDir;
           preStart = ''
  -          mkdir -p --mode 755 ${pulseRuntimePath}
  -          chown -R pulse:pulse ${pulseRuntimePath}
  +          mkdir -p --mode 755 ${stateDir}
  +          chown -R pulse:pulse ${stateDir}
           '';
  -        script = ''
  -          exec pulseaudio --system -n --file="${cfg.configFile}"
  -        '';
  +        serviceConfig = {
  +          ExecStart = "${cfg.package}/bin/pulseaudio -D --log-level=${cfg.daemon.logLevel} --system --use-pid-file -n --file=${cfg.configFile}";
  +          PIDFile = "${stateDir}/pid";
  +        };
         };
       })
     ];
  
positive.code:           features (such as JACK support) that are not enabled in the
            default PulseAudio in Nixpkgs.
          '';
        };
      };
  
  
negative.code:       security.rtkit.enable = true;
      })
  
      (mkIf nonSystemWide {
        environment.etc = singleton {
          target = "pulse/default.pa";
          source = cfg.configFile;
        };
      })
  
      (mkIf systemWide {
        users.extraUsers.pulse = {
          # For some reason, PulseAudio wants UID == GID.
          uid = assert uid == gid; uid;
          group = "pulse";
          extraGroups = [ "audio" ];
          description = "PulseAudio system service user";
        };
  
        users.extraGroups.pulse.gid = gid;
  