Initial commit
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
}:
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "apple-fonts";
|
||||
version = "1.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "0xsharkboy";
|
||||
repo = "Apple-Fonts-Collection";
|
||||
tag = "v${finalAttrs.version}";
|
||||
sha256 = "sha256-8EZ7fYy6CONgyj3dHOsaVSF0oMRH+SRZclwdrMSA0h8=";
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = let
|
||||
fontDirs = ["NewYork" "SF-Compact" "SF-Mono" "SF-Pro"];
|
||||
in ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/share/fonts/{opentype,truetype}
|
||||
|
||||
${lib.concatMapStringsSep "\n" (dir: ''
|
||||
cp ${dir}/*.otf $out/share/fonts/opentype/ 2>/dev/null || true
|
||||
cp ${dir}/*.ttf $out/share/fonts/truetype/ 2>/dev/null || true
|
||||
'')
|
||||
fontDirs}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Apple Fonts Collection including SF Pro, SF Compact, SF Mono, and New York";
|
||||
homepage = "https://github.com/0xsharkboy/Apple-Fonts-Collection";
|
||||
changelog = "https://github.com/0xsharkboy/Apple-Fonts-Collection/releases/tag/v${finalAttrs.version}";
|
||||
license = lib.licenses.mit;
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
})
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
systems = ["x86_64-linux"];
|
||||
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages = {
|
||||
# instant repl with automatic flake loading
|
||||
repl = pkgs.callPackage ./repl {};
|
||||
|
||||
apple-fonts = pkgs.callPackage ./Apple-Fonts {};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
# modified from https://github.com/gytis-ivaskevicius/flake-utils/plus
|
||||
{
|
||||
coreutils,
|
||||
gnused,
|
||||
writeShellScriptBin,
|
||||
}: let
|
||||
repl = ../../lib/repl.nix;
|
||||
example = command: desc: "\\n\\u001b[33m ${command}\\u001b[0m - ${desc}";
|
||||
in
|
||||
writeShellScriptBin "repl" ''
|
||||
case "$1" in
|
||||
"-h"|"--help"|"help")
|
||||
printf "%b\n\e[4mUsage\e[0m: \
|
||||
${example "repl" "Loads system flake if available."} \
|
||||
${example "repl /path/to/flake.nix" "Loads specified flake."}\n"
|
||||
;;
|
||||
*)
|
||||
if [ -z "$1" ]; then
|
||||
nix repl -f ${repl}
|
||||
else
|
||||
nix repl --arg flakePath $(${coreutils}/bin/readlink -f $1 | ${gnused}/bin/sed 's|/flake.nix||') ${repl}
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
''
|
||||
Reference in New Issue
Block a user