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/yt/yt/package.nix | 126 -------------------------------- pkgs/by-name/yt/yt/package.unstable.nix | 126 ++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+), 126 deletions(-) delete mode 100644 pkgs/by-name/yt/yt/package.nix create mode 100644 pkgs/by-name/yt/yt/package.unstable.nix (limited to 'pkgs/by-name/yt') diff --git a/pkgs/by-name/yt/yt/package.nix b/pkgs/by-name/yt/yt/package.nix deleted file mode 100644 index 41234e19..00000000 --- a/pkgs/by-name/yt/yt/package.nix +++ /dev/null @@ -1,126 +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 . -{ - lib, - rustPlatform, - installShellFiles, - fetchgit, - gitUpdater, - # buildInputs - mpv-unwrapped, - ffmpeg-headless, - openssl, - libffi, - zlib, - curl, - deno, - # NativeBuildInputs - python3, - makeWrapper, - llvmPackages_latest, - glibc, - mold, - sqlite, - fd, - pkg-config, - SDL2, -}: let - version = "1.9.0"; - python = python3.withPackages (ps: [ps.yt-dlp]); - - mpv = mpv-unwrapped.override {ffmpeg = ffmpeg-headless;}; -in - rustPlatform.buildRustPackage (finalAttrs: { - inherit version; - pname = "yt"; - - src = fetchgit { - url = "https://git.foss-syndicate.org/bpeetz/clients/yt"; - tag = "v${version}"; - hash = "sha256-/Isgqe7Hda/1kwYY+ciQH/NBAcWvM92vDxWZ9svlQAM="; - }; - - cargoHash = "sha256-U0alYK9mhz6esVf0mad9o7Ra6tRaL9HKCOftyOg34HE="; - - buildInputs = [ - mpv.dev - ffmpeg-headless - openssl - libffi - zlib - curl.dev - python - deno - ]; - - nativeBuildInputs = [ - installShellFiles - makeWrapper - sqlite - fd - pkg-config - mold - ]; - - checkInputs = [ - # Needed for the tests in `libmpv2` - SDL2 - ]; - - passthru.updateScript = gitUpdater {rev-prefix = "v";}; - - env = let - clang_version = - lib.versions.major - llvmPackages_latest.clang-unwrapped.version; - in { - # Needed for the compile time sqlite checks. - DATABASE_URL = "sqlite://database.sqlx"; - - # Required by yt_dlp - FFMPEG_LOCATION = "${lib.getExe ffmpeg-headless}"; - - # Tell pyo3 which python to use. - PYO3_PYTHON = lib.getExe python; - - # Needed for the libmpv2. - C_INCLUDE_PATH = "${glibc.dev}/include"; - LIBCLANG_INCLUDE_PATH = "${llvmPackages_latest.clang-unwrapped.lib}/lib/clang/${clang_version}/include"; - LIBCLANG_PATH = "${llvmPackages_latest.clang-unwrapped.lib}/lib/libclang.so"; - }; - - doCheck = true; - checkFlags = [ - # All of these tests try to connect to the internet to download test data. - "--skip=select::base::test_base" - "--skip=select::file::test_file" - "--skip=select::options::test_options" - "--skip=subscriptions::import_export::test_import_export" - "--skip=subscriptions::naming_subscriptions::test_naming_subscriptions" - "--skip=videos::downloading::test_downloading" - ]; - - prePatch = '' - # Generate the sqlite db, so that we can run the comp-time sqlite checks. - bash ./scripts/mkdb.sh - ''; - - postInstall = '' - installShellCompletion --cmd yt \ - --bash <(COMPLETE=bash $out/bin/yt) \ - --fish <(COMPLETE=fish $out/bin/yt) \ - --zsh <(COMPLETE=zsh $out/bin/yt) - - # NOTE: We cannot clear the path, because we need access to the $EDITOR. <2025-04-04> - wrapProgram $out/bin/yt \ - --prefix PATH : ${lib.makeBinPath finalAttrs.buildInputs} \ - --set YTDLP_NO_PLUGINS 1 - ''; - }) diff --git a/pkgs/by-name/yt/yt/package.unstable.nix b/pkgs/by-name/yt/yt/package.unstable.nix new file mode 100644 index 00000000..41234e19 --- /dev/null +++ b/pkgs/by-name/yt/yt/package.unstable.nix @@ -0,0 +1,126 @@ +# 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 . +{ + lib, + rustPlatform, + installShellFiles, + fetchgit, + gitUpdater, + # buildInputs + mpv-unwrapped, + ffmpeg-headless, + openssl, + libffi, + zlib, + curl, + deno, + # NativeBuildInputs + python3, + makeWrapper, + llvmPackages_latest, + glibc, + mold, + sqlite, + fd, + pkg-config, + SDL2, +}: let + version = "1.9.0"; + python = python3.withPackages (ps: [ps.yt-dlp]); + + mpv = mpv-unwrapped.override {ffmpeg = ffmpeg-headless;}; +in + rustPlatform.buildRustPackage (finalAttrs: { + inherit version; + pname = "yt"; + + src = fetchgit { + url = "https://git.foss-syndicate.org/bpeetz/clients/yt"; + tag = "v${version}"; + hash = "sha256-/Isgqe7Hda/1kwYY+ciQH/NBAcWvM92vDxWZ9svlQAM="; + }; + + cargoHash = "sha256-U0alYK9mhz6esVf0mad9o7Ra6tRaL9HKCOftyOg34HE="; + + buildInputs = [ + mpv.dev + ffmpeg-headless + openssl + libffi + zlib + curl.dev + python + deno + ]; + + nativeBuildInputs = [ + installShellFiles + makeWrapper + sqlite + fd + pkg-config + mold + ]; + + checkInputs = [ + # Needed for the tests in `libmpv2` + SDL2 + ]; + + passthru.updateScript = gitUpdater {rev-prefix = "v";}; + + env = let + clang_version = + lib.versions.major + llvmPackages_latest.clang-unwrapped.version; + in { + # Needed for the compile time sqlite checks. + DATABASE_URL = "sqlite://database.sqlx"; + + # Required by yt_dlp + FFMPEG_LOCATION = "${lib.getExe ffmpeg-headless}"; + + # Tell pyo3 which python to use. + PYO3_PYTHON = lib.getExe python; + + # Needed for the libmpv2. + C_INCLUDE_PATH = "${glibc.dev}/include"; + LIBCLANG_INCLUDE_PATH = "${llvmPackages_latest.clang-unwrapped.lib}/lib/clang/${clang_version}/include"; + LIBCLANG_PATH = "${llvmPackages_latest.clang-unwrapped.lib}/lib/libclang.so"; + }; + + doCheck = true; + checkFlags = [ + # All of these tests try to connect to the internet to download test data. + "--skip=select::base::test_base" + "--skip=select::file::test_file" + "--skip=select::options::test_options" + "--skip=subscriptions::import_export::test_import_export" + "--skip=subscriptions::naming_subscriptions::test_naming_subscriptions" + "--skip=videos::downloading::test_downloading" + ]; + + prePatch = '' + # Generate the sqlite db, so that we can run the comp-time sqlite checks. + bash ./scripts/mkdb.sh + ''; + + postInstall = '' + installShellCompletion --cmd yt \ + --bash <(COMPLETE=bash $out/bin/yt) \ + --fish <(COMPLETE=fish $out/bin/yt) \ + --zsh <(COMPLETE=zsh $out/bin/yt) + + # NOTE: We cannot clear the path, because we need access to the $EDITOR. <2025-04-04> + wrapProgram $out/bin/yt \ + --prefix PATH : ${lib.makeBinPath finalAttrs.buildInputs} \ + --set YTDLP_NO_PLUGINS 1 + ''; + }) -- cgit v1.3.1