mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-25 02:46:17 +04:00
Fix Nix flake (#1455)
This commit is contained in:
parent
f77dbc7c83
commit
a2fad4fcb0
12
flake.lock
12
flake.lock
@ -2,11 +2,11 @@
|
||||
"nodes": {
|
||||
"devshell": {
|
||||
"locked": {
|
||||
"lastModified": 1639692811,
|
||||
"narHash": "sha256-wOOBH0fVsfNqw/5ZWRoKspyesoXBgiwEOUBH4c7JKEo=",
|
||||
"lastModified": 1640301433,
|
||||
"narHash": "sha256-eplae8ZNiEmxbOgwUn9IihaJfEUxoUilkwciRPGskYE=",
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"rev": "d3a1f5bec3632b33346865b1c165bf2420bb2f52",
|
||||
"rev": "f87fb932740abe1c1b46f6edd8a36ade17881666",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -41,11 +41,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1639807801,
|
||||
"narHash": "sha256-y32tMq1LTRVbMW3QN5i98iOQjQt2QSsif3ayUkD1o3g=",
|
||||
"lastModified": 1641449444,
|
||||
"narHash": "sha256-InqsyCVafPqXmK7YqUfFVpb6eVYJWUWbYXEvey0J+3c=",
|
||||
"owner": "yusdacra",
|
||||
"repo": "nix-cargo-integration",
|
||||
"rev": "b5bbaa4f5239e6f0619846f9a5380f07baa853d3",
|
||||
"rev": "d1aa15a832db331a97082b7f8c7da737a6789c77",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
37
flake.nix
37
flake.nix
@ -20,27 +20,36 @@
|
||||
# Set default package to helix-term release build
|
||||
defaultOutputs = { app = "hx"; package = "helix"; };
|
||||
overrides = {
|
||||
crateOverrides = common: _: {
|
||||
helix-term = prev: {
|
||||
# link languages and theme toml files since helix-term expects them (for tests)
|
||||
preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml} ..";
|
||||
buildInputs = (prev.buildInputs or [ ]) ++ [ common.cCompiler.cc.lib ];
|
||||
};
|
||||
crateOverrides = common: _: rec {
|
||||
# link languages and theme toml files since helix-view expects them
|
||||
helix-view = _: { preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml} .."; };
|
||||
helix-syntax = _prev: {
|
||||
helix-view = _: { preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml,base16_theme.toml} .."; };
|
||||
helix-syntax = prev: {
|
||||
src =
|
||||
let
|
||||
pkgs = common.pkgs;
|
||||
helix = pkgs.fetchgit {
|
||||
url = "https://github.com/helix-editor/helix.git";
|
||||
rev = "a8fd33ac012a79069ef1409503a2edcf3a585153";
|
||||
fetchSubmodules = true;
|
||||
sha256 = "sha256-5AtOC55ttWT+7RYMboaFxpGZML51ix93wAkYJTt+8JI=";
|
||||
};
|
||||
in
|
||||
pkgs.runCommand prev.src.name { } ''
|
||||
mkdir -p $out
|
||||
ln -s ${prev.src}/* $out
|
||||
ln -sf ${helix}/helix-syntax/languages $out
|
||||
'';
|
||||
preConfigure = "mkdir -p ../runtime/grammars";
|
||||
postInstall = "cp -r ../runtime $out/runtime";
|
||||
};
|
||||
};
|
||||
mainBuild = common: prev:
|
||||
helix-term = prev:
|
||||
let
|
||||
inherit (common) pkgs lib;
|
||||
helixSyntax = lib.buildCrate {
|
||||
root = self;
|
||||
memberName = "helix-syntax";
|
||||
defaultCrateOverrides = {
|
||||
helix-syntax = common.crateOverrides.helix-syntax;
|
||||
helix-syntax = helix-syntax;
|
||||
};
|
||||
release = false;
|
||||
};
|
||||
@ -50,7 +59,10 @@
|
||||
ln -sf ${helixSyntax}/runtime/grammars $out
|
||||
'';
|
||||
in
|
||||
lib.optionalAttrs (common.memberName == "helix-term") {
|
||||
{
|
||||
# link languages and theme toml files since helix-term expects them (for tests)
|
||||
preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml,base16_theme.toml} ..";
|
||||
buildInputs = (prev.buildInputs or [ ]) ++ [ common.cCompiler.cc.lib ];
|
||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||
postFixup = ''
|
||||
if [ -f "$out/bin/hx" ]; then
|
||||
@ -58,6 +70,7 @@
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
shell = common: prev: {
|
||||
packages = prev.packages ++ (with common.pkgs; [ lld_13 lldb cargo-tarpaulin ]);
|
||||
env = prev.env ++ [
|
||||
|
Loading…
Reference in New Issue
Block a user