From 36a74d3ebd601e270ae0c7a9e0fa831e8a6b8547 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Sat, 9 Oct 2021 01:34:41 +0200 Subject: [PATCH] add mpd ans spotifyd --- nixos/configs/pepe/mpd.nix | 94 ++++--------------------------- nixos/system/desktop/packages.nix | 2 + 2 files changed, 14 insertions(+), 82 deletions(-) diff --git a/nixos/configs/pepe/mpd.nix b/nixos/configs/pepe/mpd.nix index 03765e3..a54fa77 100644 --- a/nixos/configs/pepe/mpd.nix +++ b/nixos/configs/pepe/mpd.nix @@ -1,55 +1,13 @@ { config, lib, pkgs, ... }: - { - services.mopidy = { + services.mpd = { enable = true; - extensionPackages = with pkgs; [ - #mopidy-spotify - mopidy-iris - 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 - ''; + network.listenAddress = "any"; + musicDirectory = "/media/syncthing/music-library"; + playlistDirectory = "/media/syncthing/music-library/playlists"; }; - users.groups."syncthing".members = [ "mopidy" ]; + users.groups."syncthing".members = [ "mpd" ]; sound.enable = true; @@ -73,46 +31,18 @@ services.spotifyd.enable = true; services.spotifyd.config = '' [global] -# Your Spotify account name. -#username = "yolo" 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}" - -# 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] - # The alsa audio device to stream audio to. To get a # list of valid devices, run `aplay -L`, #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`. 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 # volume increases. For possible values, run # `spotifyd --help`. @@ -120,10 +50,10 @@ volume_controller = "alsa" # use softvol for macOS # The name that gets displayed under the connect tab on # official clients. Spaces are not allowed! -device_name = "Pepe" +device_name = "DJane" # The audio bitrate. 96, 160 or 320 kbit/s -bitrate = 160 +bitrate = 320 # The directory used to cache audio data. This setting can save # a lot of bandwidth when activated, as it will avoid re-downloading @@ -141,10 +71,10 @@ no_audio_cache = true initial_volume = "90" # If set to true, enables volume normalisation between songs. -volume_normalisation = true +volume_normalisation = false # 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. zeroconf_port = 1234 diff --git a/nixos/system/desktop/packages.nix b/nixos/system/desktop/packages.nix index 3f52f9d..e05a06b 100644 --- a/nixos/system/desktop/packages.nix +++ b/nixos/system/desktop/packages.nix @@ -379,6 +379,8 @@ in { parseUrl parseAndCopyLink + ncmpcpp + # needed for pycairo (in venv) pkgconf cairo