diff --git a/modules/mpd.nix b/modules/mpd.nix deleted file mode 100644 index 9fea4db..0000000 --- a/modules/mpd.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ pkgs, ... }: -let - mpdConf = pkgs.writeText "mpd.conf" '' - music_directory "~/Music" - playlist_directory "~/.mpd/playlists" - db_file "~/.mpd/tag_cache" - state_file "~/.mpd/state" - sticker_file "~/.mpd/sticker.sql" - - bind_to_address "127.0.0.1" - zeroconf_enabled "no" - - restore_paused "yes" - replaygain "track" - - audio_output { - type "pulse" - name "pulse" - } - - audio_output { - type "fifo" - name "fifo" - path "~/.mpd/fifo" - format "44100:16:2" - } - ''; -in -{ - imports = [ - ./pulseaudio.nix - ]; - - systemd.user.services.mpd = { - after = [ "network.target" "sound.target" ]; - description = "Music Player Daemon"; - - wantedBy = [ "default.target" ]; - partOf = [ "default.target" ]; - - serviceConfig = { - ExecStart = "${pkgs.mpd}/bin/mpd --no-daemon ${mpdConf}"; - Type = "notify"; - ExecStartPre = ''${pkgs.bash}/bin/bash -c "${pkgs.coreutils}/bin/mkdir -p ~/Music ~/.mpd/playlists"''; - }; - }; - - environment.systemPackages = with pkgs; [ - mpc_cli - (pkgs.ncmpcpp.override { visualizerSupport = true; taglibSupport = false; }) - ]; -} diff --git a/profiles/gui.nix b/profiles/gui.nix index 5eadd4c..ddb24b1 100644 --- a/profiles/gui.nix +++ b/profiles/gui.nix @@ -9,7 +9,6 @@ ../modules/fonts.nix ../modules/gui-tools.nix (import ../modules/media.nix { inherit pkgs; gui = true; }) - ../modules/mpd.nix ../modules/network-manager.nix ../modules/office.nix ../modules/pulseaudio.nix diff --git a/users/simon/base.nix b/users/simon/base.nix index f2c1395..95a2e3c 100644 --- a/users/simon/base.nix +++ b/users/simon/base.nix @@ -34,6 +34,7 @@ in ./modules/ankisyncd.nix ./modules/gtk.nix ./modules/htop.nix + ./modules/mpd.nix ./modules/sway.nix ./modules/xdg.nix ./modules/zathura.nix diff --git a/users/simon/modules/mpd.nix b/users/simon/modules/mpd.nix new file mode 100644 index 0000000..3493551 --- /dev/null +++ b/users/simon/modules/mpd.nix @@ -0,0 +1,65 @@ +{ config, pkgs, ... }: + +{ + services.mpd = { + enable = true; + musicDirectory = "~/Music"; + extraConfig = '' + zeroconf_enabled "no" + + restore_paused "yes" + replaygain "track" + + audio_output { + type "pulse" + name "pulse" + } + + audio_output { + type "fifo" + name "fifo" + path "${config.services.mpd.dataDir}/fifo" + format "44100:16:2" + } + ''; + }; + + programs.ncmpcpp = { + enable = true; + package = pkgs.ncmpcpp.override { visualizerSupport = true; taglibSupport = false; }; + mpdMusicDir = null; # does not work (not of type `null or path') + settings = { + # Visualizer + visualizer_fifo_path = "${config.services.mpd.dataDir}/fifo"; + visualizer_in_stereo = "yes"; + visualizer_look = "+|"; + visualizer_output_name = "fifo"; + visualizer_sync_interval = "15"; + visualizer_type = "spectrum"; + + # Song list formatting + song_columns_list_format = builtins.concatStringsSep " " [ + "(6f)[green]{NE}" + "(45)[white]{t|f:Title}" + "(20)[]{a}" + "(25)[cyan]{b}" + "(5f)[blue]{P}" + "(7f)[magenta]{l}" + ]; + + # Display lists in column mode by default + browser_display_mode = "columns"; + search_engine_display_mode = "columns"; + + # Faster seeking + seek_time = 5; + + # More modern UI + user_interface = "alternative"; + }; + }; + + home.packages = with pkgs; [ + mpc_cli + ]; +}