]> Skullheadx's Git Forge - nixos.git/commitdiff
mpd and rmpc
authorSkullheadx <admonty1@protonmail.com>
Sun, 26 Apr 2026 05:56:25 +0000 (01:56 -0400)
committerSkullheadx <admonty1@protonmail.com>
Sun, 26 Apr 2026 05:56:25 +0000 (01:56 -0400)
.gitignore
audio.nix
dotfiles/mpd/mpd.conf [new file with mode: 0644]
dotfiles/rmpc/config.ron [new file with mode: 0644]
dotfiles/rmpc/themes/theme.ron [new file with mode: 0644]

index 1377554ebea6f98a2c748183bc5a96852af12ac2..3819313818f61d9121ab2ec8c244aeab43041edf 100644 (file)
@@ -1 +1,2 @@
 *.swp
+*.swo
index 15adf9c961c667c392201730480ac5d76538ef08..c164680de12737331a8c6334191a9d1b07e65b4a 100644 (file)
--- a/audio.nix
+++ b/audio.nix
     };
   };
 
-  #  services.mpd = {
-  #    enable = true;
-  #    musicDirectory = "${config.home.homeDirectory}/Music";
-  #    playlistDirectory = "${config.home.homeDirectory}/.playlists";
-  #    # mixer_type "none" # maybe mess around with this some time, it will turn off volume in rmpc, but apparently it will make the sound more quality for music
-  #     extraConfig = ''
-  #                          auto_update "yes"
-  #                  audio_output {
-  #                    type "pulse"
-  #                    name "PipeWire Output"
-  #                  }
-  #                    '';
-  #  };
+  hjem.users.andrew = {
+    files = {
+      ".config/mpd/mpd.conf".text = builtins.readFile ./dotfiles/mpd/mpd.conf;
+
+      ".config/rmpc/config.ron".text = builtins.readFile ./dotfiles/rmpc/config.ron;
+      ".config/rmpc/themes/theme.ron".text = builtins.readFile ./dotfiles/rmpc/themes/theme.ron;
+
+    };
+    packages = with pkgs; [
+      mpc
+      rmpc
+    ];
+  };
+
+
+systemd.user.services.mpd = {
+  description = "Music Player Daemon";
+  wantedBy = [ "default.target" ];
+  serviceConfig = {
+    ExecStart = "${pkgs.mpd}/bin/mpd --no-daemon /home/andrew/.config/mpd/mpd.conf";
+    Restart = "on-failure";
+  };
+};
 
 }
diff --git a/dotfiles/mpd/mpd.conf b/dotfiles/mpd/mpd.conf
new file mode 100644 (file)
index 0000000..c226a77
--- /dev/null
@@ -0,0 +1,9 @@
+music_directory    "~/Music"
+playlist_directory "~/Music/.playlists"
+db_file            "~/.config/mpd/database"
+log_file           "syslog"
+
+audio_output {
+    type "pipewire"
+    name "PipeWire Output"
+}
diff --git a/dotfiles/rmpc/config.ron b/dotfiles/rmpc/config.ron
new file mode 100644 (file)
index 0000000..a43dfa0
--- /dev/null
@@ -0,0 +1,158 @@
+#![enable(implicit_some)]
+#![enable(unwrap_newtypes)]
+#![enable(unwrap_variant_newtypes)]
+(
+  address: "127.0.0.1:6600",
+  password: None,
+  theme: None,
+  cache_dir: None,
+  on_song_change: None,
+  volume_step: 5,
+  max_fps: 30,
+  scrolloff: 0,
+  wrap_navigation: false,
+  enable_mouse: true,
+  enable_config_hot_reload: true,
+  status_update_interval_ms: 1000,
+  rewind_to_start_sec: None,
+  reflect_changes_to_playlist: false,
+  select_current_song_on_change: true,
+  browser_song_sort: [Disc, Track, Artist, Title],
+  directories_sort: SortFormat(group_by_type: true, reverse: false),
+  album_art: (
+method: Auto,
+max_size_px: (width: 1200, height: 1200),
+disabled_protocols: ["http://", "https://"],
+vertical_align: Center,
+horizontal_align: Center,
+  ),
+  keybinds: (
+global: {
+    ":":       CommandMode,
+    ",":       VolumeDown,
+    "s":       Stop,
+    ".":       VolumeUp,
+    "<Tab>":   NextTab,
+    "<S-Tab>": PreviousTab,
+    "1":       SwitchToTab("Queue"),
+    "2":       SwitchToTab("Directories"),
+    "3":       SwitchToTab("Artists"),
+    "4":       SwitchToTab("Album Artists"),
+    "5":       SwitchToTab("Albums"),
+    "6":       SwitchToTab("Playlists"),
+    "7":       SwitchToTab("Search"),
+    "q":       Quit,
+    ">":       NextTrack,
+    "p":       TogglePause,
+    "<":       PreviousTrack,
+    "f":       SeekForward,
+    "z":       ToggleRepeat,
+    "x":       ToggleRandom,
+    "c":       ToggleConsume,
+    "v":       ToggleSingle,
+    "b":       SeekBack,
+    "~":       ShowHelp,
+    "u":       Update,
+    "U":       Rescan,
+    "I":       ShowCurrentSongInfo,
+    "O":       ShowOutputs,
+    "P":       ShowDecoders,
+    "R":       AddRandom,
+},
+navigation: {
+    "k":         Up,
+    "j":         Down,
+    "h":         Left,
+    "l":         Right,
+    "<Up>":      Up,
+    "<Down>":    Down,
+    "<Left>":    Left,
+    "<Right>":   Right,
+    "<C-k>":     PaneUp,
+    "<C-j>":     PaneDown,
+    "<C-h>":     PaneLeft,
+    "<C-l>":     PaneRight,
+    "<C-u>":     UpHalf,
+    "N":         PreviousResult,
+    "a":         Add,
+    "A":         AddAll,
+    "r":         Rename,
+    "n":         NextResult,
+    "g":         Top,
+    "<Space>":   Select,
+    "<C-Space>": InvertSelection,
+    "G":         Bottom,
+    "<CR>":      Confirm,
+    "i":         FocusInput,
+    "J":         MoveDown,
+    "<C-d>":     DownHalf,
+    "/":         EnterSearch,
+    "<C-c>":     Close,
+    "<Esc>":     Close,
+    "K":         MoveUp,
+    "D":         Delete,
+    "B":         ShowInfo,
+},
+queue: {
+    "D":       DeleteAll,
+    "<CR>":    Play,
+    "<C-s>":   Save,
+    "a":       AddToPlaylist,
+    "d":       Delete,
+    "C":       JumpToCurrent,
+    "X":       Shuffle,
+},
+  ),
+  search: (
+case_sensitive: false,
+ignore_diacritics: false,
+mode: Contains,
+tags: [
+    (value: "any",         label: "Any Tag"),
+    (value: "artist",      label: "Artist"),
+    (value: "album",       label: "Album"),
+    (value: "albumartist", label: "Album Artist"),
+    (value: "title",       label: "Title"),
+    (value: "filename",    label: "Filename"),
+    (value: "genre",       label: "Genre"),
+],
+  ),
+  artists: (
+album_display_mode: SplitByDate,
+album_sort_by: Date,
+album_date_tags: [Date],
+  ),
+  tabs: [
+  (
+name: "Queue",
+pane: Split(
+    direction: Horizontal,
+    panes: [(size: "60%", pane: Pane(Queue)), (size: "40%", pane: Pane(AlbumArt))],
+),
+  ),
+  (
+name: "Directories",
+pane: Pane(Directories),
+  ),
+  (
+name: "Artists",
+pane: Pane(Artists),
+  ),
+  (
+name: "Album Artists",
+pane: Pane(AlbumArtists),
+  ),
+  (
+name: "Albums",
+pane: Pane(Albums),
+  ),
+  (
+name: "Playlists",
+pane: Pane(Playlists),
+  ),
+  (
+name: "Search",
+pane: Pane(Search),
+  ),
+],
+)
diff --git a/dotfiles/rmpc/themes/theme.ron b/dotfiles/rmpc/themes/theme.ron
new file mode 100644 (file)
index 0000000..7e20f31
--- /dev/null
@@ -0,0 +1,90 @@
+#![enable(implicit_some)]
+#![enable(unwrap_newtypes)]
+#![enable(unwrap_variant_newtypes)]
+(
+    default_album_art_path: None,
+    draw_borders: false,
+    show_song_table_header: false,
+    symbols: (song: "🎵", dir: "📁", playlist: "🎼", marker: "\u{e0b0}"),
+    layout: Split(
+       direction: Vertical,
+       panes: [
+           (
+               pane: Pane(Header),
+               size: "1",
+           ),
+           (
+               pane: Pane(TabContent),
+               size: "100%",
+           ),
+           (
+               pane: Pane(ProgressBar),
+               size: "1",
+           ),
+       ],
+    ),
+    progress_bar: (
+       symbols: ["", "", "⭘", " ", " "],
+       track_style: (bg: "#1e2030"),
+       elapsed_style: (fg: "#c6a0f6", bg: "#1e2030"),
+       thumb_style: (fg: "#c6a0f6", bg: "#1e2030"),
+    ),
+    scrollbar: (
+       symbols: ["│", "█", "▲", "▼"],
+       track_style: (),
+       ends_style: (),
+       thumb_style: (fg: "#b7bdf8"),
+    ),
+    browser_column_widths: [20, 38, 42],
+    text_color: "#cad3f5",
+    background_color: "#24273a",
+    header_background_color: "#1e2030",
+    modal_background_color: None,
+    modal_backdrop: false,
+    tab_bar: (active_style: (fg: "black", bg: "#c6a0f6", modifiers: "Bold"), inactive_style: ()),
+    borders_style: (fg: "#6e738d"),
+    highlighted_item_style: (fg: "#c6a0f6", modifiers: "Bold"),
+    current_item_style: (fg: "black", bg: "#b7bdf8", modifiers: "Bold"),
+    highlight_border_style: (fg: "#b7bdf8"),
+    song_table_format: [
+       (
+           prop: (kind: Property(Artist), style: (fg: "#b7bdf8"), default: (kind: Text("Unknown"))),
+           width: "50%",
+           alignment: Right,
+       ),
+       (
+           prop: (kind: Text("-"), style: (fg: "#b7bdf8"), default: (kind: Text("Unknown"))),
+           width: "1",
+           alignment: Center,
+       ),
+       (
+           prop: (kind: Property(Title), style: (fg: "#7dc4e4"), default: (kind: Text("Unknown"))),
+           width: "50%",
+       ),
+    ],
+    header: (
+       rows: [
+           (
+               left: [
+                   (kind: Text("["), style: (fg: "#b7bdf8", modifiers: "Bold")),
+                   (kind: Property(Status(State)), style: (fg: "#b7bdf8", modifiers: "Bold")),
+                   (kind: Text("]"), style: (fg: "#b7bdf8", modifiers: "Bold"))
+               ],
+               center: [
+                   (kind: Property(Song(Artist)), style: (fg: "#eed49f", modifiers: "Bold"),
+                       default: (kind: Text("Unknown"), style: (fg: "#eed49f", modifiers: "Bold"))
+                   ),
+                   (kind: Text(" - ")),
+                   (kind: Property(Song(Title)), style: (fg: "#7dc4e4", modifiers: "Bold"),
+                       default: (kind: Text("No Song"), style: (fg: "#7dc4e4", modifiers: "Bold"))
+                   )
+               ],
+               right: [
+                   (kind: Text("Vol: "), style: (fg: "#b7bdf8", modifiers: "Bold")),
+                   (kind: Property(Status(Volume)), style: (fg: "#b7bdf8", modifiers: "Bold")),
+                   (kind: Text("% "), style: (fg: "#b7bdf8", modifiers: "Bold"))
+               ]
+           )
+       ],
+    ),
+)