From ab41e13f6ce7bd032920440db104e05ff76c0d12 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Wed, 8 Feb 2023 01:08:25 +0000 Subject: [PATCH] sourcehut.dispatchsrht: respect allowAliases Nixpkgs convention is to only add attributes for deprecation throws when config.allowAliases hasn't been explicitly disabled. This is useful as it makes it easy to test building all non-deprecated packages: nix-build --arg config '{ allowAliases = false; }' -A sourcehut Precedent for this convention in Nixpkgs is easy to find by grepping for "config.allowAliases". --- .../version-management/sourcehut/default.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/version-management/sourcehut/default.nix b/pkgs/applications/version-management/sourcehut/default.nix index 7faca39e2fe..9c9f6f40333 100644 --- a/pkgs/applications/version-management/sourcehut/default.nix +++ b/pkgs/applications/version-management/sourcehut/default.nix @@ -2,6 +2,7 @@ , callPackage , recurseIntoAttrs , nixosTests +, config }: # To expose the *srht modules, they have to be a python module so we use `buildPythonModule` @@ -28,12 +29,10 @@ let }; }; in -with python.pkgs; recurseIntoAttrs { +with python.pkgs; recurseIntoAttrs ({ inherit python; coresrht = toPythonApplication srht; buildsrht = toPythonApplication buildsrht; - # Added 2022-10-29 - dispatchsrht = throw "dispatch is deprecated. See https://sourcehut.org/blog/2022-08-01-dispatch-deprecation-plans/ for more information."; gitsrht = toPythonApplication gitsrht; hgsrht = toPythonApplication hgsrht; hubsrht = toPythonApplication hubsrht; @@ -46,4 +45,7 @@ with python.pkgs; recurseIntoAttrs { passthru.tests = { nixos-sourcehut = nixosTests.sourcehut; }; -} +} // lib.optionalAttrs config.allowAliases { + # Added 2022-10-29 + dispatchsrht = throw "dispatch is deprecated. See https://sourcehut.org/blog/2022-08-01-dispatch-deprecation-plans/ for more information."; +})