on master help sign in
build(nix): fetch submodules lazily
commit6dddd5cd1d3598564a0495bfb866df6479896043 authorYusuf Bera Ertan <y.bera003.06@protonmail.com> dateMon 21 Jun 2021, 21:03 (5 years ago) parenta70de6e
2 files changed+31−43
flake.lock+9−28 flake.nix+22−15
flake.lock+9−28
@@ -31,24 +31,6 @@
3131 "type": "github"
3232 }
3333 },
34− "helix": {
35− "flake": false,
36− "locked": {
37− "lastModified": 1624077450,
38− "narHash": "sha256-gcL519tetuEv0N+oBP8X3U4bPjwcAgzbPdgwW19qeVI=",
39− "ref": "master",
40− "rev": "1c2585202145467f0fde7ad9c571e462081c3656",
41− "revCount": 894,
42− "submodules": true,
43− "type": "git",
44− "url": "https://github.com/helix-editor/helix.git"
45− },
46− "original": {
47− "submodules": true,
48− "type": "git",
49− "url": "https://github.com/helix-editor/helix.git"
50− }
51− },
5234 "nixCargoIntegration": {
5335 "inputs": {
5436 "devshell": "devshell",
@@ -58,11 +40,11 @@
5840 "rustOverlay": "rustOverlay"
5941 },
6042 "locked": {
61− "lastModified": 1624070370,
62− "narHash": "sha256-sfFqfmerCYvk0jDeP1gfuskz7AaqDsgV8aiQrEUGdsc=",
43+ "lastModified": 1624244973,
44+ "narHash": "sha256-h+b4CwPjyibgwMYAeBaT5qBnxI0fsmGf66k23FqEH5Y=",
6345 "owner": "yusdacra",
6446 "repo": "nix-cargo-integration",
65− "rev": "85e6c1ba4c0e3e6dec5a7d1f65bcc036d2ea6ae3",
47+ "rev": "00f5df6d8e7eeeac2764b7fa2c57e2e81f5d47cd",
6648 "type": "github"
6749 },
6850 "original": {
@@ -73,11 +55,11 @@
7355 },
7456 "nixpkgs": {
7557 "locked": {
76− "lastModified": 1623580589,
77− "narHash": "sha256-Ayp1cjXpwFCkAiWUE46rj9APTltsiEBdIs2+cj+U7+c=",
58+ "lastModified": 1624024598,
59+ "narHash": "sha256-X++38oH5MKEmPW4/2WdMaHQvwJzO8pJfbnzMD7DbG1E=",
7860 "owner": "nixos",
7961 "repo": "nixpkgs",
80− "rev": "fa0326ce5233f7d592271df52c9d0812bec47b84",
62+ "rev": "33d42ad7cf2769ce6364ed4e52afa8e9d1439d58",
8163 "type": "github"
8264 },
8365 "original": {
@@ -90,7 +72,6 @@
9072 "root": {
9173 "inputs": {
9274 "flakeCompat": "flakeCompat",
93− "helix": "helix",
9475 "nixCargoIntegration": "nixCargoIntegration",
9576 "nixpkgs": "nixpkgs"
9677 }
@@ -98,11 +79,11 @@
9879 "rustOverlay": {
9980 "flake": false,
10081 "locked": {
101− "lastModified": 1624069337,
102− "narHash": "sha256-9mTcx7osE4biF2Hm/GU19s1T3+KvphWj4QaUcJh39lU=",
82+ "lastModified": 1624242197,
83+ "narHash": "sha256-J0+j4DYFaE0O0marb4QN/S1bUhpGwAjQ4O04kIYKcb8=",
10384 "owner": "oxalica",
10485 "repo": "rust-overlay",
105− "rev": "67dc2a9543a7c24591e6cb102ad0121c3a704aab",
86+ "rev": "df5d330f34b64194d64dcbafb91e82e01a89a229",
10687 "type": "github"
10788 },
10889 "original": {
flake.nix+22−15
@@ -11,15 +11,9 @@
1111 url = "github:edolstra/flake-compat";
1212 flake = false;
1313 };
14− helix = {
15− url = "https://github.com/helix-editor/helix.git";
16− type = "git";
17− flake = false;
18− submodules = true;
19− };
2014 };
2115
22− outputs = inputs@{ nixCargoIntegration, helix, ... }:
16+ outputs = inputs@{ self, nixCargoIntegration, ... }:
2317 nixCargoIntegration.lib.makeOutputs {
2418 root = ./.;
2519 buildPlatform = "crate2nix";
@@ -29,18 +23,31 @@
2923 defaultOutputs = { app = "hx"; package = "helix"; };
3024 overrides = {
3125 crateOverrides = common: _: {
32− helix-term = prev: { buildInputs = (prev.buildInputs or [ ]) ++ [ common.cCompiler.cc.lib ]; };
26+ helix-term = prev: {
27+ # link languages and theme toml files since helix-term expects them (for tests)
28+ preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml} ..";
29+ buildInputs = (prev.buildInputs or [ ]) ++ [ common.cCompiler.cc.lib ];
30+ };
3331 # link runtime since helix-core expects it because of embed_runtime feature
3432 helix-core = _: { preConfigure = "ln -s ${common.root + "/runtime"} ../runtime"; };
3533 # link languages and theme toml files since helix-view expects them
3634 helix-view = _: { preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml} .."; };
37− helix-syntax = prev: {
38− src = common.pkgs.runCommand prev.src.name { } ''
39− mkdir -p $out
40− ln -s ${prev.src}/* $out
41− ln -sf ${helix}/helix-syntax/languages $out
42− '';
43− };
35+ helix-syntax = prev:
36+ let
37+ helix = common.pkgs.fetchgit {
38+ url = "https://github.com/helix-editor/helix.git";
39+ rev = "9fd17d4ff5b81211317da1a28d2b30442a512ffc";
40+ fetchSubmodules = true;
41+ sha256 = "sha256-y652sn/tCc1XoKr3YxDZv6bS2Cmr6+9K/wzzNAMFZJw=";
42+ };
43+ in
44+ {
45+ src = common.pkgs.runCommand prev.src.name { } ''
46+ mkdir -p $out
47+ ln -s ${prev.src}/* $out
48+ ln -sf ${helix}/helix-syntax/languages $out
49+ '';
50+ };
4451 };
4552 shell = common: prev: {
4653 packages = prev.packages ++ (with common.pkgs; [ lld_10 lldb ]);