-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
spotifyd: init at 0.2.4 #55923
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
Conversation
}; | ||
|
||
users = { | ||
users.spotifyd = { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
Thanks for all your helpful comments, @worldofpeace! |
There was a problem hiding this 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 ;-)
description = "The directory where spotifyd stores its state, relative to /var/lib/."; | ||
}; | ||
|
||
config = mkOption { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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/."; |
There was a problem hiding this comment.
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}"; |
There was a problem hiding this comment.
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}"; |
There was a problem hiding this comment.
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.
@jmgrosen can you adress the comments? |
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 ]; |
There was a problem hiding this comment.
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 https://github.com/marsam/nixpkgs/commit/179aaa85c43
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
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)(Apologies if I've done something wrong, this is my first submitted PR.)