NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.16k stars 14.19k forks source link

`services.spotifyd` generates incorrect/incomplete systemd service #354825

Open koiuo opened 6 days ago

koiuo commented 6 days ago

Describe the bug

I noticed multiple issues with the service

Steps To Reproduce

Steps to reproduce the behavior:

  1. enable service with the following config (deprecated .config options is used due to another issue #354828)
    services.spotifyd = {
      enable = true;
      config = ''
        [global]
        backend = "pulseaudio"
      '';
    };
  2. try playing anything
  3. observe the daemon failing with an error

Expected behavior

Generated systemd unit should allow to either A) specify the user under which the daemon should be launched B) specify extra groups for the default user C) derive extra groups (pipewire, pulse-access) automatically by inspecting the rest of the system configuration

A and C can be combined

Notify maintainers

@matt1432

344198

Metadata

 - system: `"aarch64-linux"`
 - host os: `Linux 6.6.48, NixOS, 24.05 (Uakari), 24.05.20240830.6e99f2a`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - nixpkgs: `/nix/store/1h99qq6970gkx3j0m9w4yrrl9y99y1nk-source`

Add a :+1: reaction to issues you find important.

matt1432 commented 2 days ago

I switched to using the home-manager module for spotifyd and a user that has linger enabled because of problems like this. I'll probably try getting the system module to work but for now I'm satisfied with my setup

koiuo commented 2 days ago

home-manager seems like an overkill for simple setups on single-board computers.

Solution I have in mind is

If you confirm the issue and agree on the approach I can work on a PR a bit later.