Compare commits
2 commits
044605b25d
...
6933e2d1de
| Author | SHA1 | Date | |
|---|---|---|---|
| 6933e2d1de | |||
| dcea24afc7 |
5 changed files with 161 additions and 50 deletions
90
flake.lock
generated
90
flake.lock
generated
|
|
@ -70,11 +70,11 @@
|
|||
"bt-tracker": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1738454952,
|
||||
"narHash": "sha256-IlNgduE1J4n7Q7b6JKHJ6L+zELCZtWzoQIOClpTpOdQ=",
|
||||
"lastModified": 1738656540,
|
||||
"narHash": "sha256-bJAX5RgKgYya7WPpygdlvmh5TByY1KVOnMrOlvL2HUI=",
|
||||
"owner": "XIU2",
|
||||
"repo": "TrackersListCollection",
|
||||
"rev": "7a9a2b30a474f33c77f5ea54a64aad8beda805e7",
|
||||
"rev": "03c44392a4fad3b01d491af1f8a0b2b7b1f23abb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -440,11 +440,11 @@
|
|||
"zig": "zig"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1738275804,
|
||||
"narHash": "sha256-n9cSCLlWjc8Bc5QyZYLo5+c6MfTZjgDpUGx/FGxBiY8=",
|
||||
"lastModified": 1738619868,
|
||||
"narHash": "sha256-q4h4SY1kVkZG4t/59CmJvaKjlx+xjojhdU1HqxiQhrQ=",
|
||||
"owner": "ghostty-org",
|
||||
"repo": "ghostty",
|
||||
"rev": "c5508e7d1922842ecd3160ea73b97da1282168b3",
|
||||
"rev": "f0d276062b78658fc1f3857e9ea104788f1f4e58",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -528,11 +528,11 @@
|
|||
"rust-overlay": "rust-overlay"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1738463065,
|
||||
"narHash": "sha256-lQ5MecgzpOLXtt3JfjyRCM9xQ4X3c8yiVNztPMhbCb0=",
|
||||
"lastModified": 1738625866,
|
||||
"narHash": "sha256-0GibVm6Pfm99Lu5fcH68YGa3jO0zUdoO+V3DqmAcJTc=",
|
||||
"owner": "helix-editor",
|
||||
"repo": "helix",
|
||||
"rev": "70d452db3e0890e13f8ce9d88b861fa39fb6d95c",
|
||||
"rev": "8995ccaae25b1af2e052d0d78ed74e7d225dec5a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -549,11 +549,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1738448366,
|
||||
"narHash": "sha256-4ATtQqBlgsGqkHTemta0ydY6f7JBRXz4Hf574NHQpkg=",
|
||||
"lastModified": 1738667255,
|
||||
"narHash": "sha256-sMMQb9NydZqQ/MvvtPp+Ny0W9P0Jk0moU7SrTBlO5Vo=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "18fa9f323d8adbb0b7b8b98a8488db308210ed93",
|
||||
"rev": "7abcf59a365430b36f84eaa452a466b11e469e33",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -615,11 +615,11 @@
|
|||
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1738459562,
|
||||
"narHash": "sha256-yc31wSweci8ZJhfoIk4GQQ3T8PaYc1F29u9poaN/XnE=",
|
||||
"lastModified": 1738659223,
|
||||
"narHash": "sha256-fr3uPkLEDdmyD3CQwFBcRDl96VmkK0Lgr21BIxqk+gY=",
|
||||
"owner": "sodiboo",
|
||||
"repo": "niri-flake",
|
||||
"rev": "b195c4f59e460128ce192e1c6aa856011abc2d5f",
|
||||
"rev": "297a7208e396ab6e9de88363c538baec8d75ccbb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -648,11 +648,11 @@
|
|||
"niri-unstable": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1738404307,
|
||||
"narHash": "sha256-BFtfL5kZbIsDAMgbVP5E0HbqDapYWw4NBw1xS0AOCCc=",
|
||||
"lastModified": 1738654964,
|
||||
"narHash": "sha256-30l3hOfTW1kJXcTRQsJ9f0/wE1aaTTACKb4ch6ZlLNU=",
|
||||
"owner": "YaLTeR",
|
||||
"repo": "niri",
|
||||
"rev": "32ad545f842f4c176548e30d183d10e0a2bab752",
|
||||
"rev": "7d24ad23c2bc690b22b1f13ad4598dc8323d128b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -764,11 +764,11 @@
|
|||
"nixpkgs-stable": "nixpkgs-stable_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1738460196,
|
||||
"narHash": "sha256-Mree9Q1nzcNYwuDujRnlq53zXXL/2Spxse566MZ+Vy4=",
|
||||
"lastModified": 1738638873,
|
||||
"narHash": "sha256-BJMELQKR1gyZKM+lIPT6yMND/YIVRmTtzCHrrA6Zjs0=",
|
||||
"owner": "lilyinstarlight",
|
||||
"repo": "nixos-cosmic",
|
||||
"rev": "9919900baf436dcfe1f7ca77b736b52f6c71fef1",
|
||||
"rev": "20879a0946b62794ed73583c34b830158d9a2f21",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -779,11 +779,11 @@
|
|||
},
|
||||
"nixos-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1738391520,
|
||||
"narHash": "sha256-6HI58PKjddsC0RA0gBQlt6ox47oH//jLUHwx05RO8g0=",
|
||||
"lastModified": 1738638143,
|
||||
"narHash": "sha256-ZYMe4c4OCtIUBn5hx15PEGr0+B1cNEpl2dsaLxwY2W0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "34b64e4e1ddb14e3ffc7db8d4a781396dbbab773",
|
||||
"rev": "9bdd53f5908453e4d03f395eb1615c3e9a351f70",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -891,11 +891,11 @@
|
|||
},
|
||||
"nixpkgs-stable_2": {
|
||||
"locked": {
|
||||
"lastModified": 1738277201,
|
||||
"narHash": "sha256-6L+WXKCw5mqnUIExvqkD99pJQ41xgyCk6z/H9snClwk=",
|
||||
"lastModified": 1738574474,
|
||||
"narHash": "sha256-rvyfF49e/k6vkrRTV4ILrWd92W+nmBDfRYZgctOyolQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "666e1b3f09c267afd66addebe80fb05a5ef2b554",
|
||||
"rev": "fecfeb86328381268e29e998ddd3ebc70bbd7f7c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -907,11 +907,11 @@
|
|||
},
|
||||
"nixpkgs-stable_3": {
|
||||
"locked": {
|
||||
"lastModified": 1738277201,
|
||||
"narHash": "sha256-6L+WXKCw5mqnUIExvqkD99pJQ41xgyCk6z/H9snClwk=",
|
||||
"lastModified": 1738435198,
|
||||
"narHash": "sha256-5+Hmo4nbqw8FrW85FlNm4IIrRnZ7bn0cmXlScNsNRLo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "666e1b3f09c267afd66addebe80fb05a5ef2b554",
|
||||
"rev": "f6687779bf4c396250831aa5a32cbfeb85bb07a3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -987,11 +987,11 @@
|
|||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1738410390,
|
||||
"narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=",
|
||||
"lastModified": 1738546358,
|
||||
"narHash": "sha256-nLivjIygCiqLp5QcL7l56Tca/elVqM9FG1hGd9ZSsrg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "3a228057f5b619feb3186e986dbe76278d707b6e",
|
||||
"rev": "c6e957d81b96751a3d5967a0fd73694f303cc914",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -1019,11 +1019,11 @@
|
|||
},
|
||||
"nixpkgs_5": {
|
||||
"locked": {
|
||||
"lastModified": 1738410390,
|
||||
"narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=",
|
||||
"lastModified": 1738546358,
|
||||
"narHash": "sha256-nLivjIygCiqLp5QcL7l56Tca/elVqM9FG1hGd9ZSsrg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "3a228057f5b619feb3186e986dbe76278d707b6e",
|
||||
"rev": "c6e957d81b96751a3d5967a0fd73694f303cc914",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -1067,11 +1067,11 @@
|
|||
"nur-rycee": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1738448761,
|
||||
"narHash": "sha256-aX7DgKgXqlV3ywg3qLVAsyIUXD3xkIdR20Ot/9OEfiw=",
|
||||
"lastModified": 1738641794,
|
||||
"narHash": "sha256-MNnDZJuxMTXT1vGHQFSPJx9sJ56JjpjKulNsy01Cu8A=",
|
||||
"owner": "rycee",
|
||||
"repo": "nur-expressions",
|
||||
"rev": "f689a309f6310abba3411f3ebad9cfea3989c6b7",
|
||||
"rev": "727fbb76627296cdeab0f2367930fb1f663b2113",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -1084,11 +1084,11 @@
|
|||
"nur-xddxdd": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1738317894,
|
||||
"narHash": "sha256-xR8YeFy1g1Kp1RH6SWIne4HcbA6hv1LC77t6F/s1IwU=",
|
||||
"lastModified": 1738663503,
|
||||
"narHash": "sha256-wBhmi2r5+4gUv5Hc48O3vWiYLU8BnW45QN1k4rRY9xs=",
|
||||
"owner": "xddxdd",
|
||||
"repo": "nur-packages",
|
||||
"rev": "60cd535d18fc56e83e28f024ac4e465116097693",
|
||||
"rev": "ee35d2e43a34fa706aa6934d8262046f40d0ace8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -1233,11 +1233,11 @@
|
|||
"tinted-zed": "tinted-zed"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1738278499,
|
||||
"narHash": "sha256-q1SUyXSQ9znHTME53/vPLe+Ga3V1wW3X3gWfa8JsBUM=",
|
||||
"lastModified": 1738611626,
|
||||
"narHash": "sha256-IgjqlYPaS8Bg+jc6a691w27XDFhBeM7gkP4eDcR2EBs=",
|
||||
"owner": "danth",
|
||||
"repo": "stylix",
|
||||
"rev": "b00c9f46ae6c27074d24d2db390f0ac5ebcc329f",
|
||||
"rev": "d513f59da5856978c363d2f82103f708f4a6024d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
}:
|
||||
{
|
||||
pinentry-selector = pkgs.callPackage ./pinentry-selector.nix { };
|
||||
helix = pkgs.callPackage ./helix.nix { inherit inputs; };
|
||||
helix = pkgs.callPackage ./helix { inherit inputs; };
|
||||
juicity = pkgs.callPackage ./juicity.nix { };
|
||||
}
|
||||
// (
|
||||
|
|
|
|||
|
|
@ -3,12 +3,23 @@
|
|||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
}@args:
|
||||
let
|
||||
helix = inputs.helix.packages."${pkgs.system}".default;
|
||||
inherit (inputs.helix.packages."${pkgs.system}") helix helix-unwrapped;
|
||||
helix-core = helix-unwrapped.overrideAttrs {
|
||||
HELIX_DEFAULT_RUNTIME = "${grammarRuntime}";
|
||||
};
|
||||
helix-wrapped = (helix.override grammarConfig).passthru.wrapper helix-core;
|
||||
grammars = import ./grammars args;
|
||||
grammarOverlays = grammars.overlays;
|
||||
grammarRuntime = grammars.runtime;
|
||||
grammarConfig = {
|
||||
inherit grammarOverlays;
|
||||
};
|
||||
runtimeInputs = (
|
||||
with pkgs;
|
||||
[
|
||||
idris2Packages.idris2Lsp
|
||||
lua-language-server
|
||||
bash-language-server
|
||||
hurl
|
||||
|
|
@ -43,8 +54,8 @@ let
|
|||
in
|
||||
pkgs.symlinkJoin {
|
||||
name = "helix-wrapped";
|
||||
paths = [ helix ];
|
||||
inherit (helix) meta;
|
||||
paths = [ helix-wrapped ];
|
||||
inherit (helix-wrapped) meta;
|
||||
buildInputs = [
|
||||
pkgs.makeWrapper
|
||||
];
|
||||
94
pkgs/helix/grammars/default.nix
Normal file
94
pkgs/helix/grammars/default.nix
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
{ lib, pkgs, ... }:
|
||||
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";
|
||||
|
||||
dontConfigue = true;
|
||||
|
||||
FLAGS = [
|
||||
"-Isrc"
|
||||
"-g"
|
||||
"-O3"
|
||||
"-fPIC"
|
||||
"-fno-exceptions"
|
||||
"-Wl,-z,relro,-z,now"
|
||||
];
|
||||
|
||||
NAME = grammar.name;
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
if [[ -e src/scanner.cc ]]; then
|
||||
$CXX -c src/scanner.cc -o scanner.o $FLAGS
|
||||
elif [[ -e src/scanner.c ]]; then
|
||||
$CC -c src/scanner.c -o scanner.o $FLAGS
|
||||
fi
|
||||
|
||||
$CC -c src/parser.c -o parser.o $FLAGS
|
||||
$CXX -shared -o $NAME.so *.o
|
||||
|
||||
ls -al
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir $out
|
||||
mv $NAME.so $out/
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
fixupPhase = lib.optionalString stdenv.isLinux ''
|
||||
runHook preFixup
|
||||
|
||||
$STRIP $out/$NAME.so
|
||||
|
||||
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/queries/${name}
|
||||
cp ${value}/queries/* $out/queries/${name}/
|
||||
'') sources;
|
||||
runtime = pkgs.runCommand "helix-default-runtime" { } ''
|
||||
mkdir -p $out
|
||||
${builtins.concatStringsSep "\n" queries}
|
||||
'';
|
||||
builtGrammars = lib.listToAttrs (
|
||||
map (grammar: {
|
||||
inherit (grammar) name;
|
||||
value = buildGrammar grammar;
|
||||
}) grammars
|
||||
);
|
||||
grammarFiles = [
|
||||
./idris.nix
|
||||
];
|
||||
in
|
||||
{
|
||||
overlays = [
|
||||
(final: prev: lib.filterAttrs (n: v: !(builtins.hasAttr n prev)) builtGrammars)
|
||||
];
|
||||
inherit runtime;
|
||||
}
|
||||
6
pkgs/helix/grammars/idris.nix
Normal file
6
pkgs/helix/grammars/idris.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
name = "idris";
|
||||
owner = "kayhide";
|
||||
repo = "tree-sitter-idris";
|
||||
rev = "c56a25cf57c68ff929356db25505c1cc4c7820f6";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue