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

This commit is contained in:
Patrick Hilhorst
2018-10-29 14:51:08 +01:00
parent 79c7ccd351
commit efca8b4b97
+3 -1
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