add mpd ans spotifyd

This commit is contained in:
Ingolf Wagner 2021-10-09 01:34:41 +02:00
parent f38f69b0d2
commit 36a74d3ebd
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
2 changed files with 14 additions and 82 deletions

View file

@ -1,55 +1,13 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
services.mopidy = { services.mpd = {
enable = true; enable = true;
extensionPackages = with pkgs; [ network.listenAddress = "any";
#mopidy-spotify musicDirectory = "/media/syncthing/music-library";
mopidy-iris playlistDirectory = "/media/syncthing/music-library/playlists";
mopidy-local
mopidy-mpd
mopidy-podcast
mopidy-youtube
];
configuration = ''
[mpd]
hostname = ::
[http]
hostname = 0.0.0.0
[local]
enabled = true
media_dir = /media/syncthing/music-library
[file]
enabled = false
media_dirs =
/media/syncthing/music-library|Penis
[iris]
country = de
locale = de_DE
[audio]
output = alsasink
[stream]
enabled = true
timeout = 5000
protocols =
http
https
mms
rtmp
rtmps
rtsp
'';
}; };
users.groups."syncthing".members = [ "mopidy" ]; users.groups."syncthing".members = [ "mpd" ];
sound.enable = true; sound.enable = true;
@ -73,46 +31,18 @@
services.spotifyd.enable = true; services.spotifyd.enable = true;
services.spotifyd.config = '' services.spotifyd.config = ''
[global] [global]
# Your Spotify account name.
#username = "yolo"
username_cmd = "cat ${config.sops.secrets.spotify_user.path}" username_cmd = "cat ${config.sops.secrets.spotify_user.path}"
# A command that gets executed and can be used to
# retrieve your password.
# The command should return the password on stdout.
#
# This is an alternative to the `password` field. Both
# can't be used simultaneously.
password_cmd = "cat ${config.sops.secrets.spotify_pass.path}" password_cmd = "cat ${config.sops.secrets.spotify_pass.path}"
# If set to true, `spotifyd` tries to look up your
# password in the system's password storage.
#
# This is an alternative to the `password` field. Both
# can't be used simultaneously.
#use_keyring = true
# If set to true, `spotifyd` tries to bind to the session dbus
# and expose MPRIS controls. When running headless, without a dbus session,
# then set this to false to avoid binding errors
#
#use_mpris = true
# The audio backend used to play the your music. To get
# a list of possible backends, run `spotifyd --help`.
backend = "alsa" # use portaudio for macOS [homebrew] backend = "alsa" # use portaudio for macOS [homebrew]
# The alsa audio device to stream audio to. To get a # The alsa audio device to stream audio to. To get a
# list of valid devices, run `aplay -L`, # list of valid devices, run `aplay -L`,
#device = "alsa_audio_device" # omit for macOS #device = "alsa_audio_device" # omit for macOS
# The alsa control device. By default this is the same
# name as the `device` field.
#control = "alsa_audio_device" # omit for macOS
# The alsa mixer used by `spotifyd`. # The alsa mixer used by `spotifyd`.
mixer = "PCM" # omit for macOS mixer = "PCM" # omit for macOS
# A script that gets evaluated in the user's shell when the song changes [aliases: onevent]
on-song-change-hook = "${pkgs.mpc_cli}/bin/mpc --host localhost --port 6600 stop"
# The volume controller. Each one behaves different to # The volume controller. Each one behaves different to
# volume increases. For possible values, run # volume increases. For possible values, run
# `spotifyd --help`. # `spotifyd --help`.
@ -120,10 +50,10 @@ volume_controller = "alsa" # use softvol for macOS
# The name that gets displayed under the connect tab on # The name that gets displayed under the connect tab on
# official clients. Spaces are not allowed! # official clients. Spaces are not allowed!
device_name = "Pepe" device_name = "DJane"
# The audio bitrate. 96, 160 or 320 kbit/s # The audio bitrate. 96, 160 or 320 kbit/s
bitrate = 160 bitrate = 320
# The directory used to cache audio data. This setting can save # The directory used to cache audio data. This setting can save
# a lot of bandwidth when activated, as it will avoid re-downloading # a lot of bandwidth when activated, as it will avoid re-downloading
@ -141,10 +71,10 @@ no_audio_cache = true
initial_volume = "90" initial_volume = "90"
# If set to true, enables volume normalisation between songs. # If set to true, enables volume normalisation between songs.
volume_normalisation = true volume_normalisation = false
# The normalisation pregain that is applied for each song. # The normalisation pregain that is applied for each song.
normalisation_pregain = -10 # normalisation_pregain = -10
# The port `spotifyd` uses to announce its service over the network. # The port `spotifyd` uses to announce its service over the network.
zeroconf_port = 1234 zeroconf_port = 1234

View file

@ -379,6 +379,8 @@ in {
parseUrl parseUrl
parseAndCopyLink parseAndCopyLink
ncmpcpp
# needed for pycairo (in venv) # needed for pycairo (in venv)
pkgconf pkgconf
cairo cairo