@ -277,28 +277,31 @@ let
insecure = isMarkedInsecure attrs ;
}
// ( if hasDeniedUnfreeLicense attrs && ! ( hasAllowlistedLicense attrs ) then
{ valid = false ; reason = " u n f r e e " ; errormsg = " h a s a n u n f r e e l i c e n s e ( ‘ ${ showLicense attrs . meta . license } ’ ) " ; }
{ valid = " n o " ; reason = " u n f r e e " ; errormsg = " h a s a n u n f r e e l i c e n s e ( ‘ ${ showLicense attrs . meta . license } ’ ) " ; }
else if hasBlocklistedLicense attrs then
{ valid = false ; reason = " b l o c k l i s t e d " ; errormsg = " h a s a b l o c k l i s t e d l i c e n s e ( ‘ ${ showLicense attrs . meta . license } ’ ) " ; }
{ valid = " n o " ; reason = " b l o c k l i s t e d " ; errormsg = " h a s a b l o c k l i s t e d l i c e n s e ( ‘ ${ showLicense attrs . meta . license } ’ ) " ; }
else if ! allowBroken && attrs . meta . broken or false then
{ valid = false ; reason = " b r o k e n " ; errormsg = " i s m a r k e d a s b r o k e n " ; }
{ valid = " n o " ; reason = " b r o k e n " ; errormsg = " i s m a r k e d a s b r o k e n " ; }
else if ! allowUnsupportedSystem && hasUnsupportedPlatform attrs then
{ valid = false ; reason = " u n s u p p o r t e d " ; errormsg = " i s n o t s u p p o r t e d o n ‘ ${ hostPlatform . system } ’ " ; }
{ valid = " n o " ; reason = " u n s u p p o r t e d " ; errormsg = " i s n o t s u p p o r t e d o n ‘ ${ hostPlatform . system } ’ " ; }
else if ! ( hasAllowedInsecure attrs ) then
{ valid = false ; reason = " i n s e c u r e " ; errormsg = " i s m a r k e d a s i n s e c u r e " ; }
{ valid = " n o " ; reason = " i n s e c u r e " ; errormsg = " i s m a r k e d a s i n s e c u r e " ; }
else if checkOutputsToInstall attrs then
{ valid = false ; reason = " b r o k e n - o u t p u t s " ; errormsg = " h a s i n v a l i d m e t a . o u t p u t s T o I n s t a l l " ; }
{ valid = " n o " ; reason = " b r o k e n - o u t p u t s " ; errormsg = " h a s i n v a l i d m e t a . o u t p u t s T o I n s t a l l " ; }
else let res = checkMeta ( attrs . meta or { } ) ; in if res != [ ] then
{ valid = false ; reason = " u n k n o w n - m e t a " ; errormsg = " h a s a n i n v a l i d m e t a a t t r s e t : ${ lib . concatMapStrings ( x : " \n \t - " + x ) res } " ; }
else { valid = true ; } ) ;
{ valid = " n o " ; reason = " u n k n o w n - m e t a " ; errormsg = " h a s a n i n v a l i d m e t a a t t r s e t : ${ lib . concatMapStrings ( x : " \n \t - " + x ) res } " ; }
else { valid = " y e s " ; } ) ;
assertValidity = { meta , attrs }: let
validity = checkValidity attrs ;
in validity // {
# Throw an error if trying to evaluate an non-valid derivation
handled = if ! validity . valid
then handleEvalIssue { inherit meta attrs ; } { inherit ( validity ) reason errormsg ; }
else true ;
# Throw an error if trying to evaluate a non-valid derivation
# or, alternatively, just output a warning message.
handled =
{
no = handleEvalIssue { inherit meta attrs ; } { inherit ( validity ) reason errormsg ; } ;
yes = true ;
} . ${ validity . valid } ;
} ;
in assertValidity