make-derivation: use pname-version as default name if both are present

This commit is contained in:
Patrick Hilhorst 2018-06-06 22:04:35 +02:00
parent 79c7ccd351
commit efca8b4b97
No known key found for this signature in database
GPG key ID: 589BB0A8DAFEF2B2

View file

@ -12,7 +12,9 @@ rec {
# * https://nixos.org/nix/manual/#ssec-derivation
# Explanation about derivations in general
mkDerivation =
{ name ? ""
{ name ? if builtins.hasAttr "pname" attrs && builtins.hasAttr "version" attrs
then "${attrs.pname}-${attrs.version}"
else ""
# These types of dependencies are all exhaustively documented in
# the "Specifying Dependencies" section of the "Standard