Add mopidy
This commit is contained in:
parent
2bee56b0cb
commit
dce30b4aa6
|
@ -1,7 +1,22 @@
|
||||||
# Media players and other applications
|
# Media players and other applications
|
||||||
{ config, pkgs, unstable, ... }:
|
{ config, pkgs, lib, unstable, ... }:
|
||||||
|
let
|
||||||
|
mopidyEnv = pkgs.buildEnv {
|
||||||
|
name = "mopidy-daemon-environment";
|
||||||
|
paths = with pkgs; [
|
||||||
|
mopidy-mpd
|
||||||
|
mopidy-iris
|
||||||
|
mopidy-scrobbler
|
||||||
|
];
|
||||||
|
pathsToLink = [ "/${pkgs.mopidyPackages.python.sitePackages}" ];
|
||||||
|
buildInputs = [ pkgs.makeWrapper ];
|
||||||
|
postBuild = ''
|
||||||
|
makeWrapper ${pkgs.mopidy}/bin/mopidy $out/bin/mopidy \
|
||||||
|
--prefix PYTHONPATH : $out/${pkgs.mopidyPackages.python.sitePackages}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
# imports = [ ../../sensitive/mopidy.nix ];
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# Spotify
|
# Spotify
|
||||||
spotify
|
spotify
|
||||||
|
@ -13,6 +28,8 @@
|
||||||
unstable.obs-studio
|
unstable.obs-studio
|
||||||
# Soulseek client
|
# Soulseek client
|
||||||
nicotine-plus
|
nicotine-plus
|
||||||
|
# Mopidy + extensions
|
||||||
|
mopidy
|
||||||
];
|
];
|
||||||
|
|
||||||
# Mount music directory
|
# Mount music directory
|
||||||
|
@ -26,4 +43,24 @@
|
||||||
};
|
};
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Start mopidy as a user service, for sanity
|
||||||
|
systemd.user.services.mopidy = {
|
||||||
|
description = "Mopidy music server";
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${mopidyEnv}/bin/mopidy";
|
||||||
|
};
|
||||||
|
wants = [ "rclone-music.service" ];
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
# Same for the scanning service
|
||||||
|
systemd.user.services.mopidy-scan = {
|
||||||
|
description = "Mopidy files local scanner";
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${mopidyEnv}/bin/mopidy local scan";
|
||||||
|
Type = "oneshot";
|
||||||
|
};
|
||||||
|
wants = [ "rclone-music.service" ];
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue