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"
|
"url": "https://githuh.com/juicity/juicity"
|
||||||
},
|
},
|
||||||
"version": "4c5e8bd948ba2f72a0dd38681cf13ae532f6c9f5"
|
"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";
|
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
|
let
|
||||||
srcs = pkgs.callPackage ./_sources/generated.nix { };
|
srcs = pkgs.callPackage ./_sources/generated.nix { };
|
||||||
|
callPackage =
|
||||||
|
fn: args: pkgs.lib.callPackageWith (pkgs // { inherit inputs srcs callPackage; }) fn args;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
pinentry-selector = pkgs.callPackage ./pinentry-selector.nix { };
|
pinentry-selector = callPackage ./pinentry-selector.nix { };
|
||||||
helix = pkgs.callPackage ./helix { inherit inputs; };
|
helix = callPackage ./helix { };
|
||||||
juicity = pkgs.callPackage ./juicity.nix { inherit srcs; };
|
juicity = callPackage ./juicity.nix { };
|
||||||
}
|
}
|
||||||
// (
|
// (
|
||||||
let
|
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
|
in
|
||||||
pkgs.lib.genAttrs [ "immersive-translate" "tridactyl" ] (name: firefox-addons."${name}")
|
pkgs.lib.genAttrs [ "immersive-translate" "tridactyl" ] (name: firefox-addons."${name}")
|
||||||
)
|
)
|
||||||
// (
|
// (
|
||||||
let
|
let
|
||||||
nur-xddxdd = (pkgs.callPackage "${inputs.nur-xddxdd}/default.nix" { });
|
nur-xddxdd = (callPackage "${inputs.nur-xddxdd}/default.nix" { });
|
||||||
in
|
in
|
||||||
pkgs.lib.genAttrs [ "rime-zhwiki" "rime-moegirl" ] (name: nur-xddxdd."${name}")
|
pkgs.lib.genAttrs [ "rime-zhwiki" "rime-moegirl" ] (name: nur-xddxdd."${name}")
|
||||||
// {
|
// {
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,12 @@
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
inputs,
|
inputs,
|
||||||
|
callPackage,
|
||||||
...
|
...
|
||||||
}@args:
|
}:
|
||||||
let
|
let
|
||||||
inherit (inputs.helix.packages."${pkgs.system}") helix;
|
inherit (inputs.helix.packages."${pkgs.system}") helix;
|
||||||
runtime = import ./runtime args;
|
runtime = callPackage ./runtime.nix { };
|
||||||
runtimeInputs = (
|
runtimeInputs = (
|
||||||
with pkgs;
|
with pkgs;
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,18 @@
|
||||||
{ lib, pkgs, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
srcs,
|
||||||
|
stdenv,
|
||||||
|
runCommandNoCCLocal,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
inherit (pkgs) stdenv;
|
|
||||||
buildGrammar =
|
buildGrammar =
|
||||||
grammar:
|
grammar:
|
||||||
let
|
|
||||||
source = sources."${grammar.name}";
|
|
||||||
in
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
pname = "helix-tree-sitter-${grammar.name}";
|
pname = "helix-tree-sitter-${grammar.name}";
|
||||||
version = grammar.rev;
|
version = grammar.version;
|
||||||
src = source;
|
src = grammar.src;
|
||||||
sourceRoot = "source";
|
# sourceRoot = "source";
|
||||||
|
|
||||||
dontConfigue = true;
|
dontConfigue = true;
|
||||||
|
|
||||||
|
|
@ -59,45 +61,32 @@ let
|
||||||
runHook postFixup
|
runHook postFixup
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
grammars = map (file: import file) grammarFiles;
|
grammars = lib.filterAttrs (key: _: lib.hasPrefix "tree-sitter-" key) srcs;
|
||||||
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}
|
|
||||||
|
|
||||||
ln -s ${value}/queries/* $out/${name}/
|
queries = lib.mapAttrsToList (_: value: ''
|
||||||
'') sources;
|
mkdir -p $out/${value.name}
|
||||||
builtGrammars = lib.listToAttrs (
|
|
||||||
map (grammar: {
|
ln -s ${value.src}/queries/* $out/${value.name}/
|
||||||
inherit (grammar) name;
|
'') grammars;
|
||||||
value = buildGrammar grammar;
|
builtGrammars = builtins.mapAttrs (_: v: {
|
||||||
}) grammars
|
inherit (v) name;
|
||||||
);
|
value = buildGrammar v;
|
||||||
|
}) grammars;
|
||||||
grammarLinks = lib.mapAttrsToList (
|
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;
|
) builtGrammars;
|
||||||
grammarDir = pkgs.runCommandNoCCLocal "helix-grammars" { } ''
|
grammarDir = runCommandNoCCLocal "helix-grammars" { } ''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
|
|
||||||
${builtins.concatStringsSep "\n" grammarLinks}
|
${builtins.concatStringsSep "\n" grammarLinks}
|
||||||
'';
|
'';
|
||||||
queryDir = pkgs.runCommandNoCCLocal "helix-query" { } ''
|
queryDir = runCommandNoCCLocal "helix-query" { } ''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
|
|
||||||
${builtins.concatStringsSep "\n" queries}
|
${builtins.concatStringsSep "\n" queries}
|
||||||
'';
|
'';
|
||||||
grammarFiles = [
|
|
||||||
./idris.nix
|
|
||||||
];
|
|
||||||
in
|
in
|
||||||
pkgs.runCommandNoCCLocal "helix-runtime" { } ''
|
runCommandNoCCLocal "helix-runtime" { } ''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
|
|
||||||
ln -s ${grammarDir} $out/grammars
|
ln -s ${grammarDir} $out/grammars
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
name = "idris";
|
|
||||||
owner = "kayhide";
|
|
||||||
repo = "tree-sitter-idris";
|
|
||||||
rev = "c56a25cf57c68ff929356db25505c1cc4c7820f6";
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
[juicity]
|
[juicity]
|
||||||
src.git = "https://github.com/juicity/juicity"
|
src.git = "https://github.com/juicity/juicity"
|
||||||
fetch.git = "https://githuh.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