From 5ca82ffa08af81f36ec998e7f49f53af7496a93a Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Mon, 2 Nov 2026 19:53:17 +0100 Subject: pkgs/*: Use a `stable`/`unstable` marker in the filename --- pkgs/by-name/mp/mpp/package.nix | 90 -------------------------------- pkgs/by-name/mp/mpp/package.unstable.nix | 90 ++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 90 deletions(-) delete mode 100644 pkgs/by-name/mp/mpp/package.nix create mode 100644 pkgs/by-name/mp/mpp/package.unstable.nix (limited to 'pkgs/by-name/mp/mpp') diff --git a/pkgs/by-name/mp/mpp/package.nix b/pkgs/by-name/mp/mpp/package.nix deleted file mode 100644 index fe08ba46..00000000 --- a/pkgs/by-name/mp/mpp/package.nix +++ /dev/null @@ -1,90 +0,0 @@ -# nixos-config - My current NixOS configuration -# -# Copyright (C) 2025 Benedikt Peetz -# 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 . -{ - writeShellApplication, - symlinkJoin, - stdenv, - # Dependencies - mpc, - mpp-searchadd, - mpp-lyrics, - mpp-beetrm, - mpdpopm, - # Build dependencies - fd, - zsh, -}: let - script = writeShellApplication { - name = "mpp"; - text = builtins.readFile ./mpp.sh; - inheritPath = false; - - runtimeInputs = [ - mpc - mpp-searchadd - mpp-lyrics - mpp-beetrm - mpdpopm - ]; - }; - - mpcShare = stdenv.mkDerivation { - name = "mpp-only-share"; - nativeBuildInputs = [fd]; - strictDeps = true; - - src = mpc; - - buildPhase = '' - fixMpc() { - file_path="$1" - - new_file_path="$(echo "$file_path" | sed "s|mpc|mpp|g")" - - echo "Fixing '$file_path' -> '$new_file_path'.." - - [ -f "$file_path"] && mkdir --parents "$(dirname "$new_file_path")" - - mv "$file_path" "$new_file_path" - } - - # Copy the zsh bundled `mpc` completions to `mpp` - # TODO: Also add completions for the new subcommands <2024-11-17> - mkdir --parents share/zsh/site-functions; - cp "${zsh}/share/zsh/${zsh.version}/functions/_mpc" "share/zsh/site-functions" - - # Replace all reverences to `mpc`. First all files - fd "mpc" "." --hidden --type file | while read -r file_path; do - fixMpc "$file_path" - done - # Then their possible parent directories. - fd "mpc" "." --hidden --type directory | while read -r file_path; do - fixMpc "$file_path" - done - # Now patch all reverences to `mpc` away - fd "." --hidden --type file | while read -r file_path; do - sed --in-place 's/mpc/mpp/g' "$file_path" - done - - # TODO(@bpeetz): Also change this in man-pages. <2025-05-20> - ''; - - installPhase = '' - mkdir "$out"; - cp --recursive ./share "$out/share"; - ''; - }; -in - symlinkJoin { - name = "mpp"; - paths = [script mpcShare]; - - inherit (script) meta; - } diff --git a/pkgs/by-name/mp/mpp/package.unstable.nix b/pkgs/by-name/mp/mpp/package.unstable.nix new file mode 100644 index 00000000..fe08ba46 --- /dev/null +++ b/pkgs/by-name/mp/mpp/package.unstable.nix @@ -0,0 +1,90 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz +# 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 . +{ + writeShellApplication, + symlinkJoin, + stdenv, + # Dependencies + mpc, + mpp-searchadd, + mpp-lyrics, + mpp-beetrm, + mpdpopm, + # Build dependencies + fd, + zsh, +}: let + script = writeShellApplication { + name = "mpp"; + text = builtins.readFile ./mpp.sh; + inheritPath = false; + + runtimeInputs = [ + mpc + mpp-searchadd + mpp-lyrics + mpp-beetrm + mpdpopm + ]; + }; + + mpcShare = stdenv.mkDerivation { + name = "mpp-only-share"; + nativeBuildInputs = [fd]; + strictDeps = true; + + src = mpc; + + buildPhase = '' + fixMpc() { + file_path="$1" + + new_file_path="$(echo "$file_path" | sed "s|mpc|mpp|g")" + + echo "Fixing '$file_path' -> '$new_file_path'.." + + [ -f "$file_path"] && mkdir --parents "$(dirname "$new_file_path")" + + mv "$file_path" "$new_file_path" + } + + # Copy the zsh bundled `mpc` completions to `mpp` + # TODO: Also add completions for the new subcommands <2024-11-17> + mkdir --parents share/zsh/site-functions; + cp "${zsh}/share/zsh/${zsh.version}/functions/_mpc" "share/zsh/site-functions" + + # Replace all reverences to `mpc`. First all files + fd "mpc" "." --hidden --type file | while read -r file_path; do + fixMpc "$file_path" + done + # Then their possible parent directories. + fd "mpc" "." --hidden --type directory | while read -r file_path; do + fixMpc "$file_path" + done + # Now patch all reverences to `mpc` away + fd "." --hidden --type file | while read -r file_path; do + sed --in-place 's/mpc/mpp/g' "$file_path" + done + + # TODO(@bpeetz): Also change this in man-pages. <2025-05-20> + ''; + + installPhase = '' + mkdir "$out"; + cp --recursive ./share "$out/share"; + ''; + }; +in + symlinkJoin { + name = "mpp"; + paths = [script mpcShare]; + + inherit (script) meta; + } -- cgit v1.3.1