-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nerdfonts: separate into individual packages under namespace nerd-fonts
- Loading branch information
Showing
12 changed files
with
969 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
lib, | ||
stdenvNoCC, | ||
fetchzip, | ||
}: | ||
|
||
let | ||
releaseVersion = lib.trivial.importJSON ./release-version.json; | ||
makeNerdFont = | ||
{ | ||
pname, | ||
dirName, | ||
originalName, | ||
declaresRFN, | ||
version, | ||
longDescription, | ||
license, | ||
url, | ||
sha256, | ||
... | ||
}: | ||
stdenvNoCC.mkDerivation { | ||
inherit pname version; | ||
|
||
src = fetchzip { | ||
inherit url sha256; | ||
stripRoot = false; | ||
}; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
dst_opentype=$out/share/fonts/opentype/${dirName} | ||
dst_truetype=$out/share/fonts/truetype/${dirName} | ||
find -name \*.otf -exec mkdir -p $dst_opentype \; -exec cp -p {} $dst_opentype \; | ||
find -name \*.ttf -exec mkdir -p $dst_truetype \; -exec cp -p {} $dst_truetype \; | ||
runHook postInstall | ||
''; | ||
|
||
passthru = { | ||
updateScript = ./update.sh; | ||
inherit originalName declaresRFN; | ||
}; | ||
|
||
meta = { | ||
inherit longDescription license; | ||
homepage = "https://nerdfonts.com/"; | ||
changelog = "https://github.com/ryanoasis/nerd-fonts/blob/v${releaseVersion}/changelog.md"; | ||
platforms = lib.platforms.all; | ||
maintainers = with lib.maintainers; [ | ||
doronbehar | ||
rc-zb | ||
]; | ||
}; | ||
}; | ||
in | ||
|
||
builtins.listToAttrs ( | ||
map (font: lib.attrsets.nameValuePair font.attrName (makeNerdFont font)) ( | ||
lib.trivial.importJSON ./fonts.json | ||
) | ||
) |
Oops, something went wrong.