on master help sign in
build(nix): fix build issues
41f62c3Yusuf Bera Ertan
flake.lock+12−12
@@ -2,11 +2,11 @@
2 "nodes": {
2 "nodes": {
3 "devshell": {
3 "devshell": {
4 "locked": {
4 "locked": {
5− "lastModified": 1622711433,
5+ "lastModified": 1625086391,
6− "narHash": "sha256-rGjXz7FA7HImAT3TtoqwecByLO5yhVPSwPdaYPBFRQw=",
6+ "narHash": "sha256-IpNPv1v8s4L3CoxhwcgZIitGpcrnNgnj09X7TA0QV3k=",
7 "owner": "numtide",
7 "owner": "numtide",
8 "repo": "devshell",
8 "repo": "devshell",
9− "rev": "1f4fb67b662b65fa7cfe696fc003fcc1e8f7cc36",
9+ "rev": "4b5ac7cf7d9a1cc60b965bb51b59922f2210cbc7",
10 "type": "github"
10 "type": "github"
11 },
11 },
12 "original": {
12 "original": {
@@ -40,11 +40,11 @@
40 "rustOverlay": "rustOverlay"
40 "rustOverlay": "rustOverlay"
41 },
41 },
42 "locked": {
42 "locked": {
43− "lastModified": 1624244973,
43+ "lastModified": 1627106928,
44− "narHash": "sha256-h+b4CwPjyibgwMYAeBaT5qBnxI0fsmGf66k23FqEH5Y=",
44+ "narHash": "sha256-JaQE0BEk1G1eT539WbYyrA2re4YYL9xo7cB+ZiV4nNM=",
45 "owner": "yusdacra",
45 "owner": "yusdacra",
46 "repo": "nix-cargo-integration",
46 "repo": "nix-cargo-integration",
47− "rev": "00f5df6d8e7eeeac2764b7fa2c57e2e81f5d47cd",
47+ "rev": "e08af05413a2d53dadbd1a39976e1da0e5385970",
48 "type": "github"
48 "type": "github"
49 },
49 },
50 "original": {
50 "original": {
@@ -55,11 +55,11 @@
55 },
55 },
56 "nixpkgs": {
56 "nixpkgs": {
57 "locked": {
57 "locked": {
58− "lastModified": 1624024598,
58+ "lastModified": 1626852498,
59− "narHash": "sha256-X++38oH5MKEmPW4/2WdMaHQvwJzO8pJfbnzMD7DbG1E=",
59+ "narHash": "sha256-lOXUJvi0FJUXHTVSiC5qsMRtEUgqM4mGZpMESLuGhmo=",
60 "owner": "nixos",
60 "owner": "nixos",
61 "repo": "nixpkgs",
61 "repo": "nixpkgs",
62− "rev": "33d42ad7cf2769ce6364ed4e52afa8e9d1439d58",
62+ "rev": "16105403bdd843540cbef9c63fc0f16c1c6eaa70",
63 "type": "github"
63 "type": "github"
64 },
64 },
65 "original": {
65 "original": {
@@ -79,11 +79,11 @@
79 "rustOverlay": {
79 "rustOverlay": {
80 "flake": false,
80 "flake": false,
81 "locked": {
81 "locked": {
82− "lastModified": 1624242197,
82+ "lastModified": 1627092891,
83− "narHash": "sha256-J0+j4DYFaE0O0marb4QN/S1bUhpGwAjQ4O04kIYKcb8=",
83+ "narHash": "sha256-6nN+rfsP+SNpnL3UPbrcwZe4qfh9/NH0LWtXhn9w/a4=",
84 "owner": "oxalica",
84 "owner": "oxalica",
85 "repo": "rust-overlay",
85 "repo": "rust-overlay",
86− "rev": "df5d330f34b64194d64dcbafb91e82e01a89a229",
86+ "rev": "939f2cf1aebc86bc3e9544645b495cd05995524a",
87 "type": "github"
87 "type": "github"
88 },
88 },
89 "original": {
89 "original": {
flake.nix+40−15
@@ -28,27 +28,53 @@
28 preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml} ..";
28 preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml} ..";
29 buildInputs = (prev.buildInputs or [ ]) ++ [ common.cCompiler.cc.lib ];
29 buildInputs = (prev.buildInputs or [ ]) ++ [ common.cCompiler.cc.lib ];
30 };
30 };
31− # link runtime since helix-core expects it because of embed_runtime feature
32− helix-core = _: { preConfigure = "ln -s ${common.root + "/runtime"} ../runtime"; };
33 # link languages and theme toml files since helix-view expects them
31 # link languages and theme toml files since helix-view expects them
34 helix-view = _: { preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml} .."; };
32 helix-view = _: { preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml} .."; };
35− helix-syntax = prev:
33+ helix-syntax = prev: {
34+ src =
36− let
35+ let
37− helix = common.pkgs.fetchgit {
36+ pkgs = common.pkgs;
37+ helix = pkgs.fetchgit {
38− url = "https://github.com/helix-editor/helix.git";
38+ url = "https://github.com/helix-editor/helix.git";
39− rev = "9fd17d4ff5b81211317da1a28d2b30442a512ffc";
39+ rev = "d4bd5b37669708361a0a6cd2917464b010e6b7f5";
40− fetchSubmodules = true;
40+ fetchSubmodules = true;
41− sha256 = "sha256-y652sn/tCc1XoKr3YxDZv6bS2Cmr6+9K/wzzNAMFZJw=";
41+ sha256 = "sha256-KayR7K7UC0mT6EjHsZsCYY9IVDJzft63fGpPKGSY8nQ=";
42− };
42+ };
43− in
43+ in
44− {
45− src = common.pkgs.runCommand prev.src.name { } ''
44+ pkgs.runCommand prev.src.name { } ''
46 mkdir -p $out
45 mkdir -p $out
47 ln -s ${prev.src}/* $out
46 ln -s ${prev.src}/* $out
48 ln -sf ${helix}/helix-syntax/languages $out
47 ln -sf ${helix}/helix-syntax/languages $out
49 '';
48 '';
49+ preConfigure = "mkdir -p ../runtime/grammars";
50+ postInstall = "cp -r ../runtime $out/runtime";
50− };
51+ };
51 };
52 };
53+ mainBuild = common: prev:
54+ let
55+ inherit (common) pkgs lib;
56+ helixSyntax = lib.buildCrate {
57+ root = self;
58+ memberName = "helix-syntax";
59+ defaultCrateOverrides = {
60+ helix-syntax = common.crateOverrides.helix-syntax;
61+ };
62+ release = false;
63+ };
64+ runtimeDir = pkgs.runCommand "helix-runtime" { } ''
65+ mkdir -p $out
66+ ln -s ${common.root}/runtime/* $out
67+ ln -sf ${helixSyntax}/runtime/grammars $out
68+ '';
69+ in
70+ lib.optionalAttrs (common.memberName == "helix-term") {
71+ nativeBuildInputs = [ pkgs.makeWrapper ];
72+ postFixup = ''
73+ if [ -f "$out/bin/hx" ]; then
74+ wrapProgram "$out/bin/hx" --set HELIX_RUNTIME "${runtimeDir}"
75+ fi
76+ '';
77+ };
52 shell = common: prev: {
78 shell = common: prev: {
53 packages = prev.packages ++ (with common.pkgs; [ lld_10 lldb cargo-tarpaulin ]);
79 packages = prev.packages ++ (with common.pkgs; [ lld_10 lldb cargo-tarpaulin ]);
54 env = prev.env ++ [
80 env = prev.env ++ [
@@ -57,7 +83,6 @@
57 { name = "RUSTFLAGS"; value = "-C link-arg=-fuse-ld=lld -C target-cpu=native"; }
83 { name = "RUSTFLAGS"; value = "-C link-arg=-fuse-ld=lld -C target-cpu=native"; }
58 ];
84 ];
59 };
85 };
60− build = _: prev: { rootFeatures = prev.rootFeatures ++ [ "embed_runtime" ]; };
61 };
86 };
62 };
87 };
63}
88}