@@ -20,44 +20,57 @@
20 # Set default package to helix-term release build
20 # Set default package to helix-term release build
21 defaultOutputs = { app = "hx"; package = "helix"; };
21 defaultOutputs = { app = "hx"; package = "helix"; };
22 overrides = {
22 overrides = {
23− crateOverrides = common: _: {
23+ crateOverrides = common: _: rec {
25− # link languages and theme toml files since helix-term expects them (for tests)
26− preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml} ..";
27− buildInputs = (prev.buildInputs or [ ]) ++ [ common.cCompiler.cc.lib ];
29 # link languages and theme toml files since helix-view expects them
24 # link languages and theme toml files since helix-view expects them
30− helix-view = _: { preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml} .."; };
25+ helix-view = _: { preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml,base16_theme.toml} .."; };
31− helix-syntax = _prev: {
26+ helix-syntax = prev: {
30+ helix = pkgs.fetchgit {
31+ url = "https://github.com/helix-editor/helix.git";
32+ rev = "a8fd33ac012a79069ef1409503a2edcf3a585153";
33+ fetchSubmodules = true;
34+ sha256 = "sha256-5AtOC55ttWT+7RYMboaFxpGZML51ix93wAkYJTt+8JI=";
37+ pkgs.runCommand prev.src.name { } ''
39+ ln -s ${prev.src}/* $out
40+ ln -sf ${helix}/helix-syntax/languages $out
32 preConfigure = "mkdir -p ../runtime/grammars";
42 preConfigure = "mkdir -p ../runtime/grammars";
33 postInstall = "cp -r ../runtime $out/runtime";
43 postInstall = "cp -r ../runtime $out/runtime";
35− };
45+ helix-term = prev:
36− mainBuild = common: prev:
38− inherit (common) pkgs lib;
47+ inherit (common) pkgs lib;
39− helixSyntax = lib.buildCrate {
48+ helixSyntax = lib.buildCrate {
40− root = self;
49+ root = self;
41− memberName = "helix-syntax";
50+ memberName = "helix-syntax";
42− defaultCrateOverrides = {
51+ defaultCrateOverrides = {
43− helix-syntax = common.crateOverrides.helix-syntax;
52+ helix-syntax = helix-syntax;
45− release = false;
56+ runtimeDir = pkgs.runCommand "helix-runtime" { } ''
58+ ln -s ${common.root}/runtime/* $out
59+ ln -sf ${helixSyntax}/runtime/grammars $out
63+ # link languages and theme toml files since helix-term expects them (for tests)
64+ preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml,base16_theme.toml} ..";
65+ buildInputs = (prev.buildInputs or [ ]) ++ [ common.cCompiler.cc.lib ];
66+ nativeBuildInputs = [ pkgs.makeWrapper ];
68+ if [ -f "$out/bin/hx" ]; then
69+ wrapProgram "$out/bin/hx" --set HELIX_RUNTIME "${runtimeDir}"
47− runtimeDir = pkgs.runCommand "helix-runtime" { } ''
49− ln -s ${common.root}/runtime/* $out
50− ln -sf ${helixSyntax}/runtime/grammars $out
53− lib.optionalAttrs (common.memberName == "helix-term") {
54− nativeBuildInputs = [ pkgs.makeWrapper ];
56− if [ -f "$out/bin/hx" ]; then
57− wrapProgram "$out/bin/hx" --set HELIX_RUNTIME "${runtimeDir}"
61 shell = common: prev: {
74 shell = common: prev: {
62 packages = prev.packages ++ (with common.pkgs; [ lld_13 lldb cargo-tarpaulin ]);
75 packages = prev.packages ++ (with common.pkgs; [ lld_13 lldb cargo-tarpaulin ]);
63 env = prev.env ++ [
76 env = prev.env ++ [