Commit 1517e6f

HPCesia <me@hpcesia.com>
2026-08-27 05:27:02
packages: deprecate some packages
1 parent 83b3893
lib/default.nix
@@ -10,4 +10,16 @@ with pkgs.lib; {
           nurRenamed = true;
         };
     }));
+
+  deprecatePackage = name: reason: drv:
+    derivations.warnOnInstantiate
+    "${name} has been deprecated: ${reason}"
+    (drv.overrideAttrs (old: {
+      meta =
+        (old.meta or {})
+        // {
+          nurDeprecated = true;
+          nurDeprecatedReason = reason;
+        };
+    }));
 }
pkgs/artalk/default.nix
@@ -1,61 +0,0 @@
-{
-  lib,
-  buildGoModule,
-  fetchFromGitHub,
-  installShellFiles,
-  versionCheckHook,
-  stdenv,
-  nixosTests,
-  callPackage,
-  artalk-frontend ? callPackage ./frontend.nix {},
-}: let
-  pname = "artalk";
-  version = "2.9.1";
-
-  src = fetchFromGitHub {
-    owner = "ArtalkJS";
-    repo = "artalk";
-    tag = "v${version}";
-    hash = "sha256-gzagE3muNpX/dwF45p11JAN9ElsGXNFQ3fCvF1QhvdU=";
-  };
-in
-  buildGoModule {
-    inherit src pname version;
-
-    vendorHash = "sha256-oAqYQzOUjly97H5L5PQ9I2SO2KqiUVxdJA+eoPrHD6Q=";
-
-    ldflags = [
-      "-s"
-      "-w"
-    ];
-
-    preBuild = ''
-      cp -r ${artalk-frontend}/* ./public
-    '';
-
-    nativeBuildInputs = [installShellFiles];
-
-    postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
-      installShellCompletion --cmd artalk \
-        --bash <($out/bin/artalk completion bash) \
-        --fish <($out/bin/artalk completion fish) \
-        --zsh <($out/bin/artalk completion zsh)
-    '';
-
-    doInstallCheck = true;
-    nativeInstallCheckInputs = [versionCheckHook];
-    versionCheckProgramArg = "-v";
-
-    passthru.tests = {
-      inherit (nixosTests) artalk;
-    };
-
-    meta = {
-      description = "Self-hosted comment system";
-      homepage = "https://github.com/ArtalkJS/Artalk";
-      changelog = "https://github.com/ArtalkJS/Artalk/releases/tag/v${version}";
-      license = lib.licenses.mit;
-      maintainers = with lib.maintainers; [moraxyc];
-      mainProgram = "artalk";
-    };
-  }
pkgs/artalk/frontend.nix
@@ -1,60 +0,0 @@
-{
-  fetchFromGitHub,
-  nodejs,
-  pnpm_10,
-  fetchPnpmDeps,
-  pnpmConfigHook,
-  stdenv,
-  lib,
-}: let
-  pname = "artalk-frontend";
-  version = "2.9.1";
-
-  src = fetchFromGitHub {
-    owner = "ArtalkJS";
-    repo = "artalk";
-    tag = "v${version}";
-    hash = "sha256-gzagE3muNpX/dwF45p11JAN9ElsGXNFQ3fCvF1QhvdU=";
-  };
-in
-  stdenv.mkDerivation (finalAttrs: {
-    inherit pname version src;
-
-    nativeBuildInputs = [
-      nodejs
-      pnpmConfigHook
-      pnpm_10
-    ];
-
-    pnpmDeps = fetchPnpmDeps {
-      inherit (finalAttrs) pname version src;
-      pnpm = pnpm_10;
-      fetcherVersion = 3;
-      hash = "sha256-dss1p/8YSR2TcT2zUoFiJnBLaUyeAA+l5wNLtJAfupo=";
-    };
-
-    buildPhase = ''
-      runHook preBuild
-
-      pnpm build:all
-      pnpm build:auth
-
-      runHook postBuild
-    '';
-
-    installPhase = ''
-      runHook preInstall
-
-      mkdir -p $out/{dist/{i18n,plugins},sidebar}
-
-      # dist
-      cp ./ui/artalk/dist/{Artalk,ArtalkLite}.{css,js} $out/dist
-      cp ./ui/artalk/dist/i18n/*.js $out/dist/i18n
-      cp ./ui/plugin-*/dist/*.js $out/dist/plugins
-
-      # sidebar
-      cp -r ./ui/artalk-sidebar/dist/* $out/sidebar
-
-      runHook postInstall
-    '';
-  })
pkgs/dwproton-bin/default.nix
@@ -1,58 +0,0 @@
-# Modify From https://github.com/powerofthe69/nix-gaming-edge
-{
-  lib,
-  stdenv,
-  fetchzip,
-  renameInternalName ? true,
-}:
-stdenv.mkDerivation {
-  pname = "dwproton";
-  version = "11.0-11";
-
-  src = fetchzip {
-    url = "https://dawn.wine/dawn-winery/dwproton/releases/download/dwproton-11.0-11/dwproton-11.0-11-x86_64.tar.xz";
-    hash = "sha256-p1x1UAuXLG0MpYcyrssudKwpCRlKAPPxrv7UFyPe2lI=";
-  };
-
-  outputs = [
-    "out"
-    "steamcompattool"
-  ];
-
-  installPhase = ''
-    runHook preInstall
-
-    # Create the steamcompat directory
-    mkdir -p $steamcompattool
-    cp -r ./* $steamcompattool/
-
-    # Remove broken symlinks from upstream tarball
-    find $steamcompattool -xtype l -delete
-
-    # Modify the display name
-    sed -i -r "s|\"display_name\".*|\"display_name\" \"dwproton\"|" \
-      $steamcompattool/compatibilitytool.vdf
-
-    ${lib.optionalString renameInternalName ''
-      sed -i -r 's|"dwproton-[^"]*"(\s*// Internal name)|"dwproton"\1|' $steamcompattool/compatibilitytool.vdf
-    ''}
-
-    # Create a real folder so that Steam doesn't require reselecting compatibility tool on update
-    mkdir -p $out/share/
-
-    # Create a real folder so that Steam doesn't require reselecting compatibility tool on update
-    mkdir -p $out/share/steam/compatibilitytools.d/dwproton
-
-    #Symlink the files INSIDE, not the folder itself. Oopsie
-    ln -s $steamcompattool/* $out/share/steam/compatibilitytools.d/dwproton/
-
-    runHook postInstall
-  '';
-
-  meta = {
-    description = "Dawn Winery's custom Proton fork with fixes for various games";
-    homepage = "https://dawn.wine/dawn-winery/dwproton";
-    license = lib.licenses.bsd3;
-    platforms = ["x86_64-linux"];
-  };
-}
pkgs/nocturne/default.nix
@@ -1,72 +0,0 @@
-# Modifed from https://forge.kruemmelspalter.org/communix/nur-packages/src/branch/main/pkgs/nocturne/default.nix
-# Also in NUR https://github.com/nix-community/nur-combined/blob/4c3b2c48edfcb14533c0989fbfd3ba7f68200f9a/repos/Baum/pkgs/nocturne/default.nix
-{
-  lib,
-  stdenv,
-  python3,
-  fetchFromGitHub,
-  gtk4,
-  libadwaita,
-  libsecret,
-  meson,
-  ninja,
-  blueprint-compiler,
-  pkg-config,
-  wrapGAppsHook4,
-  desktop-file-utils,
-  gst_all_1,
-  gobject-introspection,
-  xdg-user-dirs,
-}:
-stdenv.mkDerivation {
-  pname = "nocturne";
-  version = "1.3.2";
-
-  src = fetchFromGitHub {
-    owner = "Jeffser";
-    repo = "Nocturne";
-    rev = "cf2b2866b5028725cba988ee9155fde2e6eedbe0";
-    hash = "sha256-mtt7+6OG2/oSFv15DsXuid1E8cJgDFK6ek/S48EPXK4=";
-  };
-
-  nativeBuildInputs = [
-    blueprint-compiler
-    desktop-file-utils
-    gobject-introspection
-    meson
-    ninja
-    pkg-config
-    wrapGAppsHook4
-  ];
-
-  buildInputs = [
-    gst_all_1.gstreamer
-    gtk4
-    libadwaita
-    libsecret
-    xdg-user-dirs
-    (python3.withPackages (py:
-      with py; [
-        colorthief
-        mpris-server
-        requests
-        syncedlyrics
-        tinytag
-      ]))
-  ];
-
-  preFixup = ''
-    gappsWrapperArgs+=(
-      --prefix GI_TYPELIB_PATH : "${gtk4}/lib/girepository-1.0"
-      --prefix GI_TYPELIB_PATH : "${libadwaita}/lib/girepository-1.0"
-      --prefix PATH : "${lib.getBin xdg-user-dirs}/bin"
-    )
-  '';
-
-  meta = with lib; {
-    description = "An Adwaita Music Player / Library Manager ";
-    homepage = "https://github.com/Jeffser/Nocturne";
-    license = licenses.gpl3Only;
-    platforms = platforms.linux;
-  };
-}
scripts/gen-readme.py
@@ -81,7 +81,7 @@ let
           }};
         in
           if isDer v then
-            if v.meta.nurRenamed or false then [] else [ pkgInfo ]
+            if v.meta.nurRenamed or v.meta.nurDeprecated or false then [] else [ pkgInfo ]
           else if isScope v then collect fullPrefix v
           else []
       ) names;
ci.nix
@@ -8,46 +8,58 @@
 #
 # then your CI will be able to build and cache only those packages for
 # which this is possible.
-
-{ pkgs ? import <nixpkgs> { } }:
-
-with builtins;
-let
-  isReserved = n: n == "lib" || n == "overlays" || n == "nixosModules" || n == "homeModules" || n == "darwinModules" || n == "flakeModules";
+{pkgs ? import <nixpkgs> {}}:
+with builtins; let
+  isReserved = n:
+    n
+    == "lib"
+    || n == "overlays"
+    || n == "nixosModules"
+    || n == "homeModules"
+    || n == "darwinModules"
+    || n == "flakeModules";
   isDerivation = p: isAttrs p && p ? type && p.type == "derivation";
   isBuildable = p: let
     licenseFromMeta = p.meta.license or [];
-    licenseList = if builtins.isList licenseFromMeta then licenseFromMeta else [licenseFromMeta];
-  in !(p.meta.broken or false) && builtins.all (license: license.free or true) licenseList;
+    licenseList =
+      if builtins.isList licenseFromMeta
+      then licenseFromMeta
+      else [licenseFromMeta];
+  in
+    !(p.meta.broken or false)
+    && !(p.meta.nurRenamed or false)
+    && !(p.meta.nurDeprecated or false)
+    && builtins.all (license: license.free or true) licenseList;
   isCacheable = p: !(p.preferLocalBuild or false);
   shouldRecurseForDerivations = p: isAttrs p && p.recurseForDerivations or false;
 
-  nameValuePair = n: v: { name = n; value = v; };
+  nameValuePair = n: v: {
+    name = n;
+    value = v;
+  };
 
   concatMap = builtins.concatMap or (f: xs: concatLists (map f xs));
 
-  flattenPkgs = s:
-    let
-      f = p:
-        if shouldRecurseForDerivations p then flattenPkgs p
-        else if isDerivation p then [ p ]
-        else [ ];
-    in
+  flattenPkgs = s: let
+    f = p:
+      if shouldRecurseForDerivations p
+      then flattenPkgs p
+      else if isDerivation p
+      then [p]
+      else [];
+  in
     concatMap f (attrValues s);
 
   outputsOf = p: map (o: p.${o}) p.outputs;
 
-  nurAttrs = import ./default.nix { inherit pkgs; };
-
-  nurPkgs =
-    flattenPkgs
-      (listToAttrs
-        (map (n: nameValuePair n nurAttrs.${n})
-          (filter (n: !isReserved n)
-            (attrNames nurAttrs))));
+  nurAttrs = import ./default.nix {inherit pkgs;};
 
-in
-rec {
+  nurPkgs = flattenPkgs (
+    listToAttrs (
+      map (n: nameValuePair n nurAttrs.${n}) (filter (n: !isReserved n) (attrNames nurAttrs))
+    )
+  );
+in rec {
   buildPkgs = filter isBuildable nurPkgs;
   cachePkgs = filter isCacheable buildPkgs;
 
default.nix
@@ -19,9 +19,9 @@ in {
   # flakeModules = { }; # flake-parts modules
   overlays = import ./overlays; # nixpkgs overlays
 
-  artalk = callPackage ./pkgs/artalk {};
+  artalk = selfLib.deprecatePackage "artalk" "use the package of the same name from nixpkgs instead" pkgs.artalk;
 
-  dwproton-bin = callPackage ./pkgs/dwproton-bin {};
+  dwproton-bin = selfLib.deprecatePackage "dwproton-bin" "use the package of the same name from nixpkgs instead" pkgs.dwproton-bin;
 
   elio = callPackage ./pkgs/elio {};
 
@@ -41,7 +41,7 @@ in {
 
   musly-player = callPackage ./pkgs/musly-player {};
 
-  nocturne = callPackage ./pkgs/nocturne {};
+  nocturne = selfLib.deprecatePackage "nocturne" "use the package of the same name from nixpkgs instead" pkgs.nocturne;
 
   particle-music = callPackage ./pkgs/particle-music {};
 
README.md
@@ -9,8 +9,6 @@
 
 | Path | Name | Version | License | Description |
 | --- | --- | --- | --- | --- |
-| `artalk` | [artalk](https://github.com/ArtalkJS/Artalk) | `2.9.1` | [MIT](https://spdx.org/licenses/MIT.html) | Self-hosted comment system |
-| `dwproton-bin` | [dwproton](https://dawn.wine/dawn-winery/dwproton) | `11.0-11` | [BSD-3-Clause](https://spdx.org/licenses/BSD-3-Clause.html) | Dawn Winery's custom Proton fork with fixes for various games |
 | `elio` | [elio](https://github.com/elio-fm/elio) | `1.11.1` | [MIT](https://spdx.org/licenses/MIT.html) | Snappy, batteries-included terminal file manager with rich previews, inline images, bulk actions, and trash support |
 | `gitmal` | [gitmal](https://github.com/antonmedv/gitmal) | `1.0.2` | [MIT](https://spdx.org/licenses/MIT.html) |  A static page generator for repos |
 | `harmonoid` | [harmonoid](https://harmonoid.com/) | `0.3.22` | **Unfree** | Plays & manages your music library. Looks beautiful & juicy. |
@@ -19,7 +17,6 @@
 | `miaomiaowu` | [miaomiaowu](https://github.com/iluobei/miaomiaowu) | `0.7.8` | [MIT](https://spdx.org/licenses/MIT.html) | Personal Clash subscriptions management system |
 | `mo2-lint` | [mo2-lint](https://github.com/Furglitch/modorganizer2-linux-installer) | `7.0.0-rc6` | [GPL-3.0-only](https://spdx.org/licenses/GPL-3.0-only.html) | An easy-to-use Mod Organizer 2 installer for Linux, rewrited in Python. |
 | `musly-player` | [musly-player](https://github.com/dddevid/Musly) | `2.0.1` | [CC-BY-NC-SA-4.0](https://spdx.org/licenses/CC-BY-NC-SA-4.0.html) | A beautiful Flutter music streaming client for Subsonic-compatible servers with a modern Apple Music-inspired UI. |
-| `nocturne` | [nocturne](https://github.com/Jeffser/Nocturne) | `1.3.2` | [GPL-3.0-only](https://spdx.org/licenses/GPL-3.0-only.html) | An Adwaita Music Player / Library Manager  |
 | `particle-music` | [particle-music](https://github.com/AfalpHy/ParticleMusic) | `2.2.1` | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | A cross-platform local music player based on Flutter |
 | `shimmie2` | [shimmie2](https://github.com/shish/shimmie2) | `2.12.2` | [GPL-2.0-only](https://spdx.org/licenses/GPL-2.0-only.html) | An easy-to-install community image gallery (aka booru) |
 | `spritz-wine-bin.cachyos` | [spritz-wine-cachyos-bin-10.0-11](https://github.com/NelloKudo/spritz-wine) | `10.0-11` | [MIT](https://spdx.org/licenses/MIT.html) | Spritz-Wine builds for some games  |