add source to nvfetch of tree-sitter lib
This commit is contained in:
parent
922a964a7d
commit
7c38ed1723
7 changed files with 76 additions and 48 deletions
|
|
@ -18,5 +18,27 @@
|
|||
"url": "https://githuh.com/juicity/juicity"
|
||||
},
|
||||
"version": "4c5e8bd948ba2f72a0dd38681cf13ae532f6c9f5"
|
||||
},
|
||||
"tree-sitter-idris": {
|
||||
"cargoLocks": null,
|
||||
"date": "2024-11-05",
|
||||
"extract": null,
|
||||
"name": "tree-sitter-idris",
|
||||
"passthru": {
|
||||
"name": "idris"
|
||||
},
|
||||
"pinned": false,
|
||||
"src": {
|
||||
"deepClone": false,
|
||||
"fetchSubmodules": false,
|
||||
"leaveDotGit": false,
|
||||
"name": null,
|
||||
"rev": "c56a25cf57c68ff929356db25505c1cc4c7820f6",
|
||||
"sha256": "sha256-aOAxb0KjhSwlNX/IDvGwEysYvImgUEIDeNDOWRl1qNk=",
|
||||
"sparseCheckout": [],
|
||||
"type": "git",
|
||||
"url": "https://github.com/kayhide/tree-sitter-idris"
|
||||
},
|
||||
"version": "c56a25cf57c68ff929356db25505c1cc4c7820f6"
|
||||
}
|
||||
}
|
||||
|
|
@ -15,4 +15,19 @@
|
|||
};
|
||||
date = "2025-02-20";
|
||||
};
|
||||
tree-sitter-idris = {
|
||||
pname = "tree-sitter-idris";
|
||||
version = "c56a25cf57c68ff929356db25505c1cc4c7820f6";
|
||||
src = fetchgit {
|
||||
url = "https://github.com/kayhide/tree-sitter-idris";
|
||||
rev = "c56a25cf57c68ff929356db25505c1cc4c7820f6";
|
||||
fetchSubmodules = false;
|
||||
deepClone = false;
|
||||
leaveDotGit = false;
|
||||
sparseCheckout = [ ];
|
||||
sha256 = "sha256-aOAxb0KjhSwlNX/IDvGwEysYvImgUEIDeNDOWRl1qNk=";
|
||||
};
|
||||
name = "idris";
|
||||
date = "2024-11-05";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,21 +5,23 @@
|
|||
}:
|
||||
let
|
||||
srcs = pkgs.callPackage ./_sources/generated.nix { };
|
||||
callPackage =
|
||||
fn: args: pkgs.lib.callPackageWith (pkgs // { inherit inputs srcs callPackage; }) fn args;
|
||||
in
|
||||
{
|
||||
pinentry-selector = pkgs.callPackage ./pinentry-selector.nix { };
|
||||
helix = pkgs.callPackage ./helix { inherit inputs; };
|
||||
juicity = pkgs.callPackage ./juicity.nix { inherit srcs; };
|
||||
pinentry-selector = callPackage ./pinentry-selector.nix { };
|
||||
helix = callPackage ./helix { };
|
||||
juicity = callPackage ./juicity.nix { };
|
||||
}
|
||||
// (
|
||||
let
|
||||
firefox-addons = (pkgs.callPackage "${inputs.nur-rycee}/pkgs/firefox-addons/default.nix" { });
|
||||
firefox-addons = (callPackage "${inputs.nur-rycee}/pkgs/firefox-addons/default.nix" { });
|
||||
in
|
||||
pkgs.lib.genAttrs [ "immersive-translate" "tridactyl" ] (name: firefox-addons."${name}")
|
||||
)
|
||||
// (
|
||||
let
|
||||
nur-xddxdd = (pkgs.callPackage "${inputs.nur-xddxdd}/default.nix" { });
|
||||
nur-xddxdd = (callPackage "${inputs.nur-xddxdd}/default.nix" { });
|
||||
in
|
||||
pkgs.lib.genAttrs [ "rime-zhwiki" "rime-moegirl" ] (name: nur-xddxdd."${name}")
|
||||
// {
|
||||
|
|
|
|||
|
|
@ -2,11 +2,12 @@
|
|||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
callPackage,
|
||||
...
|
||||
}@args:
|
||||
}:
|
||||
let
|
||||
inherit (inputs.helix.packages."${pkgs.system}") helix;
|
||||
runtime = import ./runtime args;
|
||||
runtime = callPackage ./runtime.nix { };
|
||||
runtimeInputs = (
|
||||
with pkgs;
|
||||
[
|
||||
|
|
|
|||
|
|
@ -1,16 +1,18 @@
|
|||
{ lib, pkgs, ... }:
|
||||
{
|
||||
lib,
|
||||
srcs,
|
||||
stdenv,
|
||||
runCommandNoCCLocal,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (pkgs) stdenv;
|
||||
buildGrammar =
|
||||
grammar:
|
||||
let
|
||||
source = sources."${grammar.name}";
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
pname = "helix-tree-sitter-${grammar.name}";
|
||||
version = grammar.rev;
|
||||
src = source;
|
||||
sourceRoot = "source";
|
||||
version = grammar.version;
|
||||
src = grammar.src;
|
||||
# sourceRoot = "source";
|
||||
|
||||
dontConfigue = true;
|
||||
|
||||
|
|
@ -59,45 +61,32 @@ let
|
|||
runHook postFixup
|
||||
'';
|
||||
};
|
||||
grammars = map (file: import file) grammarFiles;
|
||||
sources = lib.listToAttrs (
|
||||
map (grammar: {
|
||||
inherit (grammar) name;
|
||||
value = builtins.fetchTree {
|
||||
type = "github";
|
||||
inherit (grammar) owner repo rev;
|
||||
};
|
||||
}) grammars
|
||||
);
|
||||
queries = lib.mapAttrsToList (name: value: ''
|
||||
mkdir -p $out/${name}
|
||||
grammars = lib.filterAttrs (key: _: lib.hasPrefix "tree-sitter-" key) srcs;
|
||||
|
||||
ln -s ${value}/queries/* $out/${name}/
|
||||
'') sources;
|
||||
builtGrammars = lib.listToAttrs (
|
||||
map (grammar: {
|
||||
inherit (grammar) name;
|
||||
value = buildGrammar grammar;
|
||||
}) grammars
|
||||
);
|
||||
queries = lib.mapAttrsToList (_: value: ''
|
||||
mkdir -p $out/${value.name}
|
||||
|
||||
ln -s ${value.src}/queries/* $out/${value.name}/
|
||||
'') grammars;
|
||||
builtGrammars = builtins.mapAttrs (_: v: {
|
||||
inherit (v) name;
|
||||
value = buildGrammar v;
|
||||
}) grammars;
|
||||
grammarLinks = lib.mapAttrsToList (
|
||||
name: value: "ln -s ${value}/${name}.so $out/${name}.so"
|
||||
_: value: "ln -s ${value.value}/${value.name}.so $out/${value.name}.so"
|
||||
) builtGrammars;
|
||||
grammarDir = pkgs.runCommandNoCCLocal "helix-grammars" { } ''
|
||||
grammarDir = runCommandNoCCLocal "helix-grammars" { } ''
|
||||
mkdir -p $out
|
||||
|
||||
${builtins.concatStringsSep "\n" grammarLinks}
|
||||
'';
|
||||
queryDir = pkgs.runCommandNoCCLocal "helix-query" { } ''
|
||||
queryDir = runCommandNoCCLocal "helix-query" { } ''
|
||||
mkdir -p $out
|
||||
|
||||
${builtins.concatStringsSep "\n" queries}
|
||||
'';
|
||||
grammarFiles = [
|
||||
./idris.nix
|
||||
];
|
||||
in
|
||||
pkgs.runCommandNoCCLocal "helix-runtime" { } ''
|
||||
runCommandNoCCLocal "helix-runtime" { } ''
|
||||
mkdir -p $out
|
||||
|
||||
ln -s ${grammarDir} $out/grammars
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
name = "idris";
|
||||
owner = "kayhide";
|
||||
repo = "tree-sitter-idris";
|
||||
rev = "c56a25cf57c68ff929356db25505c1cc4c7820f6";
|
||||
}
|
||||
|
|
@ -1,3 +1,8 @@
|
|||
[juicity]
|
||||
src.git = "https://github.com/juicity/juicity"
|
||||
fetch.git = "https://githuh.com/juicity/juicity"
|
||||
|
||||
[tree-sitter-idris]
|
||||
src.git = "https://github.com/kayhide/tree-sitter-idris"
|
||||
fetch.git = "https://github.com/kayhide/tree-sitter-idris"
|
||||
passthru.name = "idris"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue