From efca8b4b97cab7653cc369973fb6267d160c494a Mon Sep 17 00:00:00 2001 From: Patrick Hilhorst Date: Wed, 6 Jun 2018 22:04:35 +0200 Subject: [PATCH] make-derivation: use pname-version as default name if both are present --- pkgs/stdenv/generic/make-derivation.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index e06faed30a1e..8fd58c3cbe91 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -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