Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spotifyd: init at 0.2.4 #55923

Closed
wants to merge 7 commits into from
Closed

spotifyd: init at 0.2.4 #55923

wants to merge 7 commits into from

Conversation

jmgrosen
Copy link

@jmgrosen jmgrosen commented Feb 17, 2019

Motivation for this change

Spotifyd is a nice spotify connect server. I worked around the issues in #47172 by just not using the avx version of rust-crypto (achieved through a patch).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

(Apologies if I've done something wrong, this is my first submitted PR.)

};

users = {
users.spotifyd = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably should use systemd's DynamicUser and probably StateDirectory as well.

homepage = https://github.com/Spotifyd/spotifyd;
license = with licenses; [ gpl3 ];
maintainers = [ maintainers.jmgrosen ];
platforms = platforms.all;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think buildRustPackage sets this for us, also I don't think this would build for all platforms anyway.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find anywhere that suggests buildRustPackage does this -- at the least, the example in the nixpkgs manual still has a meta section. I added (what I think should be) darwin support in my latest commit, so I think platforms.all is appropriate too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find anywhere that suggests buildRustPackage does this -- at the least, the example in the nixpkgs manual still has a meta section.

Ahh, yes that is correct.

. I added (what I think should be) darwin support in my latest commit, so I think platforms.all is appropriate too.

I think all is way too broad in this context. If you want darwin and linux support you can use unix.

@jmgrosen
Copy link
Author

Thanks for all your helpful comments, @worldofpeace!

Copy link
Contributor

@flokli flokli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very excited to see this! Some nitpicks ;-)

pkgs/top-level/all-packages.nix Show resolved Hide resolved
description = "The directory where spotifyd stores its state, relative to /var/lib/.";
};

config = mkOption {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this be made an attrset instead, which gets assembled into config below the [global] section?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe just generate the ini with lib.generators.toINI?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that's what I meant :-)

dataDir = mkOption {
default = "spotifyd";
type = types.str;
description = "The directory where spotifyd stores its state, relative to /var/lib/.";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to make this configurable? Wonder about the usecases, given it's a unit with dynamic users and the "state" should be mostly caches, right?

after = [ "network.target" "sound.target" ];
description = "spotifyd, a Spotify playing daemon";
serviceConfig = {
ExecStart = "${pkgs.spotifyd}/bin/spotifyd --no-daemon --config ${spotifydConf}";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably don't need to pass --no-daemon - systemd journal should capture syslog() calls.

RestartSec = 12;
DynamicUser = true;
StateDirectory = "${cfg.dataDir}";
Environment = "HOME=/var/lib/${cfg.dataDir}";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that only to set cache_path? We could probably also use the corresponding command line option.

@flokli flokli mentioned this pull request Feb 17, 2019
9 tasks
@flokli
Copy link
Contributor

flokli commented Mar 6, 2019

@jmgrosen can you adress the comments?

@anderslundstedt
Copy link
Contributor

Any progress on this?

# buildRustPackage currently seems to have some problems with [replace]
# directives in Cargo files (see #30742 and #47172), so don't use the
# replacement.
cargoPatches = [ ./noavxcrypto.patch ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spotifyd 0.2.11 was released and doesn't required this marsam@179aaa85c43

@flokli
Copy link
Contributor

flokli commented Jun 25, 2019

@marsam it seems like @jmgrosen is not pursuing this PR any further. Maybe you could pick it up, and open a followup PR, adressing the comments above?

@anderslundstedt
Copy link
Contributor

anderslundstedt commented Jul 19, 2019

@marsam @flokli: I took the liberty of picking this up. New pull request: #65092

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants