2021-12-20 13:37:26 -05:00
|
|
|
# Media players and other applications
|
2022-01-31 22:34:32 -05:00
|
|
|
{ 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
|
2021-12-20 13:37:26 -05:00
|
|
|
{
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
# Spotify
|
|
|
|
spotify
|
|
|
|
# Latest version of vlc
|
|
|
|
unstable.vlc
|
|
|
|
# Plex client
|
|
|
|
plex-media-player
|
|
|
|
# OBS studio for screen recording
|
|
|
|
unstable.obs-studio
|
2022-01-31 15:40:53 -05:00
|
|
|
# Soulseek client
|
|
|
|
nicotine-plus
|
2022-01-31 22:34:32 -05:00
|
|
|
# Mopidy + extensions
|
|
|
|
mopidy
|
2021-12-20 13:37:26 -05:00
|
|
|
];
|
2022-01-31 18:04:46 -05:00
|
|
|
|
|
|
|
# Mount music directory
|
|
|
|
systemd.user.services.rclone-music = {
|
|
|
|
description = "Rclone mount ~/Music";
|
|
|
|
serviceConfig = {
|
|
|
|
# So we can pick up the fusermount wrapper, this is a less than ideal way to do this
|
|
|
|
Environment = "PATH=/usr/bin:/run/wrappers/bin/";
|
|
|
|
Type = "notify";
|
2022-02-01 00:18:08 -05:00
|
|
|
ExecStart = "${pkgs.rclone}/bin/rclone mount music: /home/nathan/Music --vfs-cache-mode full --vfs-cache-max-size 32Gi --vfs-read-chunk-size 4Mi --buffer-size 32Mi --vfs-read-ahead 128Mi --config /home/nathan/.config/rclone/rclone.conf --cache-dir /home/nathan/.cache/rclone --no-checksum --no-modtime --transfers 8";
|
2022-01-31 18:04:46 -05:00
|
|
|
};
|
|
|
|
enable = true;
|
|
|
|
};
|
2022-01-31 22:34:32 -05:00
|
|
|
|
|
|
|
# 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" ];
|
|
|
|
};
|
|
|
|
|
2021-12-20 13:37:26 -05:00
|
|
|
}
|