home-manager module

This commit is contained in:
Reid 2024-09-11 15:29:00 -07:00
parent ae824fcb47
commit f909e8c6b7
Signed by: reidlab
GPG key ID: DAF5EAF6665839FD
6 changed files with 103 additions and 19 deletions

View file

@ -2,8 +2,6 @@
a rust application to scrobble your currently playing song on last.fm with mpris
upd 2024-08-27: i'm adding a home-manager module, eventually!
## limitations
unfortunately, because of how most mpris players work, the [Track_Id](https://specifications.freedesktop.org/mpris-spec/latest/Player_Interface.html#Simple-Type:Track_Id) (unique identifier for every song in the tracklist) object is very rarely supported, or, if supported, implemented incorrectly (looking at you, [Cider](https://cider.sh/)) meaning it is impossible to tell if the track has been played twice in a row. this means you cannot have succssive scrobbles of the same song, sorry! besides this, i'd say the program is feature complete.
@ -20,10 +18,39 @@ you also have the option to define your mpris bus name, which will instead wait
1. the nix way
simply just run it:
```sh
nix run git+https://git.reidlab.pink/reidlab/lastfmpris.git
```
or import it into your flake like so:
```nix
lastfmpris.url = "git+https://git.reidlab.pink/reidlab/lastfmpris.git";
# in your `homeManagerConfiguration`:
imports = [
inputs.lastfmpris.homeManagerModules.lastfmpris;
];
```
and then use it as a service in your `homeManagerConfiguration`:
```nix
services.lastfmpris = {
enable = true;
settings = {
global = {
# player_bus = "org.mpris.MediaPlayer2.mpv";
username = "ILoveLastDotFm";
password = builtins.readFile /etc/lastfm-password;
api_key = builtins.readFile /etc/lastfm-api-key;
api_secret = builtins.readFile /etc/lastfm-api-secret;
}
};
};
```
2. the normal way
first, clone repository: