diff options
| author | Akshay Nair <phenax5@gmail.com> | 2022-08-11 18:21:14 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2022-08-11 18:21:14 +0530 |
| commit | 0156e5e9b6bfb6ddee079d1d021d177041cd0f44 (patch) | |
| tree | f17ef9f0c1de0892f1ca86d823a743c2bec8ac80 | |
| parent | 44c721023d0a48db6dbba4b5aee1f45d062bb4f3 (diff) | |
| download | nixos-config-0156e5e9b6bfb6ddee079d1d021d177041cd0f44.tar.gz nixos-config-0156e5e9b6bfb6ddee079d1d021d177041cd0f44.zip | |
feat: music player config
| -rw-r--r-- | modules/music.home.nix | 97 | ||||
| -rw-r--r-- | packages.nix | 1 | ||||
| m--------- | packages/shotkey/source | 0 | ||||
| -rwxr-xr-x | scripts/bin/vimv | 2 | ||||
| -rwxr-xr-x | scripts/music/player.sh | 2 | ||||
| -rwxr-xr-x | scripts/notify.sh | 2 |
6 files changed, 61 insertions, 43 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; + }; + }; } diff --git a/packages.nix b/packages.nix index e715f68..ecf3954 100644 --- a/packages.nix +++ b/packages.nix @@ -98,6 +98,7 @@ let alsaUtils pavucontrol obs-studio + inkscape # qjackctl #qsynth diff --git a/packages/shotkey/source b/packages/shotkey/source -Subproject 9a47b6a6c19bf40487f2c29cbce86e4d84fc556 +Subproject faae717314d8c2ef46df5618d29325a833ba451 diff --git a/scripts/bin/vimv b/scripts/bin/vimv index 3c78afb..ae781cf 100755 --- a/scripts/bin/vimv +++ b/scripts/bin/vimv @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Lists the current directory's files in Vim, so you can edit it and save to rename them # USAGE: vimv [file1 file2] diff --git a/scripts/music/player.sh b/scripts/music/player.sh index 76f4988..e7989e1 100755 --- a/scripts/music/player.sh +++ b/scripts/music/player.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash player() { playerctl --player=mopidy "$@"; } diff --git a/scripts/notify.sh b/scripts/notify.sh index 5111b87..2c07dee 100755 --- a/scripts/notify.sh +++ b/scripts/notify.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # All the wrapping wierdness to add support for cron # https://wiki.archlinux.org/index.php/Desktop_notifications#Usage_in_programming |
