Skip to content

Commit

Permalink
Merge pull request #68 from epics-extensions/dont-require-license-url
Browse files Browse the repository at this point in the history
lib/documentation: don't require licenses to have an URL
  • Loading branch information
minijackson authored Apr 22, 2024
2 parents ae62f8c + 3f5615f commit 97fab50
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/documentation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,21 @@
in
mapRecursiveDrvsToList' "" f attrset;

maybeUrl = text: destination:
if destination == null
then text
else "[${text}](${destination})";

licenseLink = license: self.maybeUrl license.fullName (license.url or null);

licenseList = pkg:
if lib.isList pkg.meta.license
then
lib.concatMapStringsSep
"\n"
(license: " - [${license.fullName}](${license.url})")
(license: " - ${self.licenseLink license}")
pkg.meta.license
else " - [${pkg.meta.license.fullName}](${pkg.meta.license.url})";
else " - ${self.licenseLink pkg.meta.license}";

maintainerInfo = maintainer:
if maintainer ? github
Expand Down

0 comments on commit 97fab50

Please sign in to comment.