Skip to content

Commit

Permalink
mpd
Browse files Browse the repository at this point in the history
  • Loading branch information
suderman committed Nov 6, 2024
1 parent 2f9df4e commit 077a6b6
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions configurations/cog/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
services.pipewire.enable = true;
security.rtkit.enable = true;
hardware.bluetooth.enable = true;
services.mpd.enable = true;

# framework_tool
environment.systemPackages = with pkgs; [
Expand Down
1 change: 1 addition & 0 deletions configurations/kit/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
hardware.bluetooth.enable = true;
services.pipewire.enable = true;
security.rtkit.enable = true;
services.mpd.enable = true;

# Memory management
services.earlyoom.enable = true;
Expand Down
35 changes: 35 additions & 0 deletions modules/mpd/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# services.mpd.enable = true;
{ config, lib, pkgs, ... }: let

cfg = config.services.mpd;
inherit (lib) mkIf;

in {

config = mkIf cfg.enable {

services.mpd = {
network.listenAddress = "any";
network.port = 6600;
# musicDirectory = "";
extraConfig = ''
audio_output {
type "pulse"
name "Local Pulseaudio"
server "127.0.0.1" # add this line - MPD must connect to the local sound server
}
'';
};

users.groups.media.members = [ cfg.user ];
hardware.pulseaudio.extraConfig = "load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1";
networking.firewall.allowedTCPPorts = [ cfg.network.port ];

environment.systemPackages = with pkgs; [
ncmpcpp
mpc-cli
];

};

}

0 comments on commit 077a6b6

Please sign in to comment.