aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/mp/mpp-searchadd
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xpkgs/by-name/mp/mpp-searchadd/mpp-searchadd.sh21
-rw-r--r--pkgs/by-name/mp/mpp-searchadd/package.nix21
2 files changed, 30 insertions, 12 deletions
diff --git a/pkgs/by-name/mp/mpp-searchadd/mpp-searchadd.sh b/pkgs/by-name/mp/mpp-searchadd/mpp-searchadd.sh
index 3fe9a6b6..89909ed9 100755
--- a/pkgs/by-name/mp/mpp-searchadd/mpp-searchadd.sh
+++ b/pkgs/by-name/mp/mpp-searchadd/mpp-searchadd.sh
@@ -1,14 +1,23 @@
#!/usr/bin/env dash
-# shellcheck source=/dev/null
-SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
-tracks="$(mktmp)"
-beet list "$@" --path >"$tracks"
+# Run `beets` once, to trigger eventual beets migrations.
+# Otherwise, these might screw with our file adding (because `beets` prints them on stdout,
+# for some reason !?)
+beet --version >/dev/null
-while read -r track; do
+beet list "$@" --path | while read -r track; do
mpc add "$track"
-done <"$tracks"
+done
mpc playlist
# vim: ft=sh
diff --git a/pkgs/by-name/mp/mpp-searchadd/package.nix b/pkgs/by-name/mp/mpp-searchadd/package.nix
index a98472d1..91ff05e9 100644
--- a/pkgs/by-name/mp/mpp-searchadd/package.nix
+++ b/pkgs/by-name/mp/mpp-searchadd/package.nix
@@ -1,15 +1,24 @@
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
{
- sysLib,
+ writeShellApplication,
+ # Dependencies.
mpc,
beets,
}:
-sysLib.writeShellScript {
+writeShellApplication {
name = "mpp-searchadd";
- src = ./mpp-searchadd.sh;
- generateCompletions = false;
- keepPath = false;
+ text = builtins.readFile ./mpp-searchadd.sh;
+ inheritPath = false;
- dependencies = [
+ runtimeInputs = [
mpc
beets
];