Commit ab41e13f authored by Alyssa Ross's avatar Alyssa Ross Committed by Winter
Browse files

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".
parent 86f9c0bb
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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.";
})