Skip to content

Commit

Permalink
connect mpd to piperwire
Browse files Browse the repository at this point in the history
  • Loading branch information
ksevelyar committed Nov 8, 2023
1 parent 1767d35 commit 7902502
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 25 deletions.
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion hosts/hk47.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ args@{ config, lib, pkgs, ... }:
../services/journald.nix
../services/databases/postgresql.nix
../services/databases/redis.nix
../services/mpd.nix
../services/x.nix
../services/x/picom.nix
../services/x/redshift.nix
Expand Down
16 changes: 7 additions & 9 deletions hosts/laundry.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ args@{ config, lib, pkgs, ... }:
../hardware/bluetooth.nix
../hardware/mouse.nix
../hardware/intel-cpu.nix
# ../hardware/pipeware.nix
../hardware/pulseaudio.nix
../hardware/pipeware.nix
# ../hardware/pulseaudio.nix
../hardware/ssd.nix
(import ../hardware/power-management.nix ({ pkgs = pkgs; battery = "BAT1"; }))

Expand All @@ -38,7 +38,6 @@ args@{ config, lib, pkgs, ... }:
../services/journald.nix
../services/databases/postgresql.nix
../services/databases/redis.nix
../services/mpd.nix
../services/x.nix
../services/x/picom.nix
../services/x/redshift.nix
Expand Down Expand Up @@ -71,12 +70,11 @@ args@{ config, lib, pkgs, ... }:
express.autoStart = false;
};

# environment.systemPackages = with pkgs; [
# vmpk
# qsynth
# qjackctl
# ];

environment.systemPackages = with pkgs; [
vmpk
qsynth
qjackctl
];
# microbit v2
services.udev.extraRules = ''
SUBSYSTEM=="usb", ATTR{idVendor}=="0d28", ATTR{idProduct}=="0204", MODE:="666"
Expand Down
1 change: 0 additions & 1 deletion hosts/pepes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
../services/vpn.nix
../services/net/avahi.nix

# ../services/mpd.nix
# ../services/vm/hypervisor.nix
];

Expand Down
1 change: 0 additions & 1 deletion hosts/tv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ args@{ config, lib, pkgs, ... }:
../packages/pass.nix
../packages/tmux.nix

../services/mpd.nix
../services/journald.nix
../services/x.nix
../services/x/redshift.nix
Expand Down
20 changes: 13 additions & 7 deletions services/mpd.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{ pkgs, ... }:
{ pkgs, user, ... }:
{
hardware.pulseaudio.extraConfig = "load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1";
services.mpd.user = user;
systemd.services.mpd.environment = {
# https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/609
# User-id 1000 must match above user. MPD will look inside this directory for the PipeWire socket.
XDG_RUNTIME_DIR = "/run/user/1000";
};

services.mpd = {
enable = true;
musicDirectory = "/data/music"; # https://www.off-the-beat.com/flac-vs-mp3/
musicDirectory = "/data/music";
extraConfig = ''
audio_output {
type "pulse"
name "pulse"
type "pipewire"
name "pipewire"
server "127.0.0.1"
}
Expand All @@ -32,12 +38,12 @@

# fetch metadata
## https://picard-docs.musicbrainz.org/en/tutorials/acoustid.html
# rename files with picard name script `%artist% - %title%`
# rename files with picard name script `%artist% - %title%`
## https://picard-docs.musicbrainz.org/en/config/options_filerenaming_editor.html
picard
flac # metaflac --list (fzf)

# downcase dirs
# downcase dirs
mmv # mmv '*' '#l1'
];

Expand Down
1 change: 1 addition & 0 deletions users/ksevelyar.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ in
{
imports = [
(import ./shared.nix (args // { user = user; email = email; name = name; }))
(import ../services/mpd.nix (args // { user = user; }))
(import ../services/mpd/mpdscribble.nix (args // { user = user; listenbrainz_user = user; }))
] ++ [
(lib.mkIf (config.services.xserver.enable) (import ../services/x/polybar.nix (args // { user = user; })))
Expand Down

0 comments on commit 7902502

Please sign in to comment.