aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2022-08-11 18:21:14 +0530
committerAkshay Nair <phenax5@gmail.com>2022-08-11 18:21:14 +0530
commit0156e5e9b6bfb6ddee079d1d021d177041cd0f44 (patch)
treef17ef9f0c1de0892f1ca86d823a743c2bec8ac80 /modules
parent44c721023d0a48db6dbba4b5aee1f45d062bb4f3 (diff)
downloadnixos-config-0156e5e9b6bfb6ddee079d1d021d177041cd0f44.tar.gz
nixos-config-0156e5e9b6bfb6ddee079d1d021d177041cd0f44.zip
feat: music player config
Diffstat (limited to '')
-rw-r--r--modules/music.home.nix97
1 files changed, 57 insertions, 40 deletions
diff --git a/modules/music.home.nix b/modules/music.home.nix
index fbd1119..d320475 100644
--- a/modules/music.home.nix
+++ b/modules/music.home.nix
@@ -2,47 +2,15 @@
let
visualizer_name = "my_fifo";
visualizer_fifo = "/tmp/mpd.fifo";
+ mpd = {
+ host = "127.0.0.1";
+ port = 6600;
+ musicDir = "${config.home.homeDirectory}/Downloads/music";
+ playlistDir = "${config.home.homeDirectory}/Downloads/music/playlist";
+ };
in
{
- home.packages = with pkgs; [ mpc_cli ];
-
- services.mpd = {
- enable = true;
- musicDirectory = "${config.home.homeDirectory}/Downloads/music";
- playlistDirectory = "${config.home.homeDirectory}/Downloads/music/playlist";
- network = {
- listenAddress = "127.0.0.1";
- port = 6600;
- };
- extraConfig = ''
- user "imsohexy"
- group "users"
- restore_paused "yes"
- metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc"
- auto_update "yes"
- auto_update_depth "5"
- follow_outside_symlinks "yes"
- follow_inside_symlinks "yes"
-
- input {
- plugin "curl"
- }
-
- audio_output {
- type "pipewire"
- name "My PipeWire Device"
- }
-
- audio_output {
- type "fifo"
- name "${visualizer_name}"
- path "${visualizer_fifo}"
- format "44100:16:2"
- }
-
- filesystem_charset "UTF-8"
- '';
- };
+ home.packages = with pkgs; [ mpc_cli playerctl ];
programs.ncmpcpp = {
enable = true;
@@ -92,7 +60,7 @@ in
visualizer_output_name = visualizer_name;
visualizer_type = "spectrum";
visualizer_in_stereo = "yes";
- visualizer_look = "+|";
+ visualizer_look = "●●";
visualizer_color = "white, cyan, blue, magenta, red, red, black";
visualizer_spectrum_smooth_look = "yes";
visualizer_autoscale = "yes";
@@ -122,4 +90,53 @@ in
[ "ctrl-l" "show_lyrics" ]
];
};
+
+ services.mpd = {
+ enable = true;
+ musicDirectory = mpd.musicDir;
+ playlistDirectory = mpd.playlistDir;
+ network = {
+ listenAddress = mpd.host;
+ port = mpd.port;
+ };
+ extraConfig = ''
+ user "imsohexy"
+ group "users"
+ restore_paused "yes"
+ metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc"
+ auto_update "yes"
+ auto_update_depth "5"
+ follow_outside_symlinks "yes"
+ follow_inside_symlinks "yes"
+
+ input {
+ plugin "curl"
+ }
+
+ audio_output {
+ type "pipewire"
+ name "My PipeWire Device"
+ }
+
+ audio_output {
+ type "fifo"
+ name "${visualizer_name}"
+ path "${visualizer_fifo}"
+ format "44100:16:2"
+ }
+
+ filesystem_charset "UTF-8"
+ '';
+ };
+
+ services.mpdris2 = {
+ enable = true;
+ notifications = false;
+ multimediaKeys = false;
+ mpd = {
+ host = mpd.host;
+ port = mpd.port;
+ musicDirectory = mpd.musicDir;
+ };
+ };
}