on master help sign in
Fix Nix flake (#1455)
a2fad4fJared Ramirez
flake.lock+6−6
@@ -2,11 +2,11 @@
2 "nodes": {
2 "nodes": {
3 "devshell": {
3 "devshell": {
4 "locked": {
4 "locked": {
5− "lastModified": 1639692811,
5+ "lastModified": 1640301433,
6− "narHash": "sha256-wOOBH0fVsfNqw/5ZWRoKspyesoXBgiwEOUBH4c7JKEo=",
6+ "narHash": "sha256-eplae8ZNiEmxbOgwUn9IihaJfEUxoUilkwciRPGskYE=",
7 "owner": "numtide",
7 "owner": "numtide",
8 "repo": "devshell",
8 "repo": "devshell",
9− "rev": "d3a1f5bec3632b33346865b1c165bf2420bb2f52",
9+ "rev": "f87fb932740abe1c1b46f6edd8a36ade17881666",
10 "type": "github"
10 "type": "github"
11 },
11 },
12 "original": {
12 "original": {
@@ -41,11 +41,11 @@
41 ]
41 ]
42 },
42 },
43 "locked": {
43 "locked": {
44− "lastModified": 1639807801,
44+ "lastModified": 1641449444,
45− "narHash": "sha256-y32tMq1LTRVbMW3QN5i98iOQjQt2QSsif3ayUkD1o3g=",
45+ "narHash": "sha256-InqsyCVafPqXmK7YqUfFVpb6eVYJWUWbYXEvey0J+3c=",
46 "owner": "yusdacra",
46 "owner": "yusdacra",
47 "repo": "nix-cargo-integration",
47 "repo": "nix-cargo-integration",
48− "rev": "b5bbaa4f5239e6f0619846f9a5380f07baa853d3",
48+ "rev": "d1aa15a832db331a97082b7f8c7da737a6789c77",
49 "type": "github"
49 "type": "github"
50 },
50 },
51 "original": {
51 "original": {
flake.nix+45−32
@@ -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 {
24− helix-term = prev: {
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 ];
28− };
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: {
27+ src =
28+ let
29+ pkgs = common.pkgs;
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=";
35+ };
36+ in
37+ pkgs.runCommand prev.src.name { } ''
38+ mkdir -p $out
39+ ln -s ${prev.src}/* $out
40+ ln -sf ${helix}/helix-syntax/languages $out
41+ '';
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";
34 };
44 };
35− };
45+ helix-term = prev:
36− mainBuild = common: prev:
37− let
46+ let
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;
53+ };
54+ release = false;
44 };
55 };
45− release = false;
56+ runtimeDir = pkgs.runCommand "helix-runtime" { } ''
57+ mkdir -p $out
58+ ln -s ${common.root}/runtime/* $out
59+ ln -sf ${helixSyntax}/runtime/grammars $out
60+ '';
61+ in
62+ {
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 ];
67+ postFixup = ''
68+ if [ -f "$out/bin/hx" ]; then
69+ wrapProgram "$out/bin/hx" --set HELIX_RUNTIME "${runtimeDir}"
70+ fi
71+ '';
46 };
72 };
47− runtimeDir = pkgs.runCommand "helix-runtime" { } ''
48− mkdir -p $out
49− ln -s ${common.root}/runtime/* $out
50− ln -sf ${helixSyntax}/runtime/grammars $out
51− '';
52− in
53− lib.optionalAttrs (common.memberName == "helix-term") {
54− nativeBuildInputs = [ pkgs.makeWrapper ];
55− postFixup = ''
56− if [ -f "$out/bin/hx" ]; then
57− wrapProgram "$out/bin/hx" --set HELIX_RUNTIME "${runtimeDir}"
58− fi
59− '';
60− };
73+ };
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 ++ [