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
Mpdscheduler #96838
base: master
Are you sure you want to change the base?
Mpdscheduler #96838
Conversation
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.
A few minor points. I don't review go
packages because I'm not familiar with it, so I just focused on the module.
d714aa8
to
c4c021a
Compare
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.
Good job 👍 Really nice work, especially for a first module.
c4c021a
to
c3310cb
Compare
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 approve of this module 👍 You did a great job! Unfortunately I do not review go
packages, so we'll have to wait for someone (maybe @kalbasit?) to review the package portion of this PR before merging.
BTW if you're interested in writing a NixOS test for this module you are highly encouraged to do so and will be awarded full bonus points 🎉
c3310cb
to
fa8a642
Compare
@aanderse I added a test as you suggested (and found a bug on the way - Would you mind to have a look at it (see fa8a642)? |
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'm really glad you decided to do a NixOS test! This looks good. I have a small suggestion, but haven't really used the testing framework much since it was ported to python
. Maybe @tfc can review the test as they are right up on the latest and greatest trends in writing NixOS tests.
nixos/tests/mpdscheduler.nix
Outdated
log_level "verbose" | ||
''; | ||
}; | ||
systemd.services.musicService = musicService {}; |
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 may be able to replace this with a single line, something more simple like...
systemd.tmpfiles.rules = [ "C /var/lib/music/Blue_Wave_Theory_-_04_-_Skyhawk_Beach.mp3 - - - - ${track}" ];
Untested, but should work.
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.
It didn't work:
systemd-tmpfiles[584]: Detected unsafe path transition /var/lib/mpd → /var/lib/mpd/music during canonicalization of /var/lib/mpd/music.
as /var/lib/mpd/
belongs to user mpd
, not root
.
However,
systemd.tmpfiles.rules = [ "L /var/lib/music/Blue_Wave_Theory_-_04_-_Skyhawk_Beach.mp3 - - - - ${track}" ];
did (with setting follow_outside_symlinks "yes"
in mpd.extraConfig
)
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 specifically set the folder to something other than /var/lib/mpd/music
to avoid the unsafe transition. If you want to use /var/lib/mpd/music
you can set the owner to mpd
, as you noticed:
systemd.tmpfiles.rules = [ "C /var/lib/music/Blue_Wave_Theory_-_04_-_Skyhawk_Beach.mp3 - mpd mpd - ${track}" ];
fa8a642
to
af672f2
Compare
@ofborg test mpdscheduler |
@AberDerBart Please fix the merge conflict. |
rev = "v${version}"; | ||
name = "${pname}-${rev}"; | ||
|
||
src = fetchFromGitHub { | ||
inherit rev; | ||
owner = "AberDerBart"; | ||
repo = "mpdscheduler"; | ||
sha256 = "1fxc416h1hisf3rdnk3h488hbapkmdpxhladbc0v6spgp6ck9y6s"; | ||
}; |
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.
rev = "v${version}"; | |
name = "${pname}-${rev}"; | |
src = fetchFromGitHub { | |
inherit rev; | |
owner = "AberDerBart"; | |
repo = "mpdscheduler"; | |
sha256 = "1fxc416h1hisf3rdnk3h488hbapkmdpxhladbc0v6spgp6ck9y6s"; | |
}; | |
src = fetchFromGitHub { | |
owner = "AberDerBart"; | |
repo = "mpdscheduler";# | |
rev = "v${version}"; | |
sha256 = "1fxc416h1hisf3rdnk3h488hbapkmdpxhladbc0v6spgp6ck9y6s"; | |
}; |
I marked this as stale due to inactivity. → More info |
Motivation for this change
Introduces the tool mpdscheduler which allows setting alarms and sleep timers for mpd.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)