Treesitter : Add parser cache path.

This commit is contained in:
Dmitry Voronin 2024-02-25 05:59:30 +03:00
parent 09c4eaa5c9
commit 7b8269edb5
5 changed files with 84 additions and 2 deletions

View file

@ -0,0 +1,81 @@
{
description = "Apple fonts.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs } @inputs:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
lib = nixpkgs.lib;
in {
packages.${system}.default = pkgs.stdenv.mkDerivation rec {
pname = "applefonts";
version = "1";
pro = pkgs.fetchurl {
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg";
sha256 = "sha256-Mu0pmx3OWiKBmMEYLNg+u2MxFERK07BQGe3WAhEec5Q=";
};
compact = pkgs.fetchurl {
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg";
sha256 = "sha256-Mkf+GK4iuUhZdUdzMW0VUOmXcXcISejhMeZVm0uaRwY=";
};
mono = pkgs.fetchurl {
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Mono.dmg";
sha256 = "sha256-tZHV6g427zqYzrNf3wCwiCh5Vjo8PAai9uEvayYPsjM=";
};
ny = pkgs.fetchurl {
url = "https://devimages-cdn.apple.com/design/resources/download/NY.dmg";
sha256 = "sha256-tn1QLCSjgo5q4PwE/we80pJavr3nHVgFWrZ8cp29qBk=";
};
nativeBuildInputs = with pkgs; [ p7zip ];
sourceRoot = ".";
dontUnpack = true;
installPhase = ''
7z x ${pro}
cd SFProFonts
7z x 'SF Pro Fonts.pkg'
7z x 'Payload~'
mkdir -p $out/fontfiles
mv Library/Fonts/* $out/fontfiles
cd ..
7z x ${mono}
cd SFMonoFonts
7z x 'SF Mono Fonts.pkg'
7z x 'Payload~'
mv Library/Fonts/* $out/fontfiles
cd ..
7z x ${compact}
cd SFCompactFonts
7z x 'SF Compact Fonts.pkg'
7z x 'Payload~'
mv Library/Fonts/* $out/fontfiles
cd ..
7z x ${ny}
cd NYFonts
7z x 'NY Fonts.pkg'
7z x 'Payload~'
mv Library/Fonts/* $out/fontfiles
mkdir -p $out/usr/share/fonts/OTF $out/usr/share/fonts/TTF
mv $out/fontfiles/*.otf $out/usr/share/fonts/OTF
mv $out/fontfiles/*.ttf $out/usr/share/fonts/TTF
rm -rf $out/fontfiles
'';
meta = {
description = "Apple San Francisco, New York fonts.";
homepage = "https://developer.apple.com/fonts/";
};
};
};
}

View file

@ -6,7 +6,7 @@
url = "git+https://git.voronind.com/voronind/linux.git"; url = "git+https://git.voronind.com/voronind/linux.git";
flake = false; flake = false;
}; };
applefonts.url = "git+https://git.voronind.com/voronind/nix_applefonts.git"; applefonts.url = "git+file:.?dir=.config/linux/system/derivation/apple_font";
# Nvim plugins. # Nvim plugins.
nvimAlign = { nvimAlign = {

View file

@ -1,3 +1,3 @@
{ environment, ... }: { { environment, ... }: {
environment.etc.wallpaper.source = ../../../wallpaper; # TODO: Use a path relative to repo. environment.etc.wallpaper.source = ./wallpaper;
} }

View file

@ -1,4 +1,5 @@
require("nvim-treesitter.configs").setup { require("nvim-treesitter.configs").setup {
parser_install_dir = "~/.cache/treesitter",
auto_install = true, auto_install = true,
-- ensure_installed = "all", -- ensure_installed = "all",
sync_install = false, sync_install = false,

View file

Before

Width:  |  Height:  |  Size: 210 KiB

After

Width:  |  Height:  |  Size: 210 KiB