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".
This commit is contained in:
parent
86f9c0bba4
commit
ab41e13f6c
|
@ -2,6 +2,7 @@
|
||||||
, callPackage
|
, callPackage
|
||||||
, recurseIntoAttrs
|
, recurseIntoAttrs
|
||||||
, nixosTests
|
, nixosTests
|
||||||
|
, config
|
||||||
}:
|
}:
|
||||||
|
|
||||||
# To expose the *srht modules, they have to be a python module so we use `buildPythonModule`
|
# To expose the *srht modules, they have to be a python module so we use `buildPythonModule`
|
||||||
|
@ -28,12 +29,10 @@ let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
with python.pkgs; recurseIntoAttrs {
|
with python.pkgs; recurseIntoAttrs ({
|
||||||
inherit python;
|
inherit python;
|
||||||
coresrht = toPythonApplication srht;
|
coresrht = toPythonApplication srht;
|
||||||
buildsrht = toPythonApplication buildsrht;
|
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;
|
gitsrht = toPythonApplication gitsrht;
|
||||||
hgsrht = toPythonApplication hgsrht;
|
hgsrht = toPythonApplication hgsrht;
|
||||||
hubsrht = toPythonApplication hubsrht;
|
hubsrht = toPythonApplication hubsrht;
|
||||||
|
@ -46,4 +45,7 @@ with python.pkgs; recurseIntoAttrs {
|
||||||
passthru.tests = {
|
passthru.tests = {
|
||||||
nixos-sourcehut = nixosTests.sourcehut;
|
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.";
|
||||||
|
})
|
||||||
|
|
Loading…
Reference in a new issue