make-derivation: use pname-version as default name if both are present
commitefca8b4b97cab7653cc369973fb6267d160c494a
authorPatrick Hilhorst <git@hilhorst.be>
dateWed 6 Jun 2018, 22:04 (8 years ago)
parent79c7ccd
pkgs/stdenv/generic/make-derivation.nix+3−1
@@ -12,7 +12,9 @@ rec {
1212 # * https://nixos.org/nix/manual/#ssec-derivation
1313 # Explanation about derivations in general
1414 mkDerivation =
15− { name ? ""
15+ { name ? if builtins.hasAttr "pname" attrs && builtins.hasAttr "version" attrs
16+ then "${attrs.pname}-${attrs.version}"
17+ else ""
1618
1719 # These types of dependencies are all exhaustively documented in
1820 # the "Specifying Dependencies" section of the "Standard