2 description = "A post-modern text editor.";
5 nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
6 rust-overlay.url = "github:oxalica/rust-overlay";
7 nixCargoIntegration = {
8 url = "github:yusdacra/nix-cargo-integration";
9 inputs.nixpkgs.follows = "nixpkgs";
10 inputs.rustOverlay.follows = "rust-overlay";
13 url = "github:edolstra/flake-compat";
18 outputs = inputs@{ self, nixCargoIntegration, ... }:
19 nixCargoIntegration.lib.makeOutputs {
21 buildPlatform = "crate2nix";
22 renameOutputs = { "helix-term" = "helix"; };
23 # Set default app to hx (binary is from helix-term release build)
24 # Set default package to helix-term release build
25 defaultOutputs = { app = "hx"; package = "helix"; };
27 crateOverrides = common: _: {
29 # link languages and theme toml files since helix-term expects them (for tests)
30 preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml} ..";
31 buildInputs = (prev.buildInputs or [ ]) ++ [ common.cCompiler.cc.lib ];
33 # link languages and theme toml files since helix-view expects them
34 helix-view = _: { preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml} .."; };
35 helix-syntax = _prev: {
36 preConfigure = "mkdir -p ../runtime/grammars";
37 postInstall = "cp -r ../runtime $out/runtime";
40 mainBuild = common: prev:
42 inherit (common) pkgs lib;
43 helixSyntax = lib.buildCrate {
45 memberName = "helix-syntax";
46 defaultCrateOverrides = {
47 helix-syntax = common.crateOverrides.helix-syntax;
51 runtimeDir = pkgs.runCommand "helix-runtime" { } ''
53 ln -s ${common.root}/runtime/* $out
54 ln -sf ${helixSyntax}/runtime/grammars $out
57 lib.optionalAttrs (common.memberName == "helix-term") {
58 nativeBuildInputs = [ pkgs.makeWrapper ];
60 if [ -f "$out/bin/hx" ]; then
61 wrapProgram "$out/bin/hx" --set HELIX_RUNTIME "${runtimeDir}"
65 shell = common: prev: {
66 packages = prev.packages ++ (with common.pkgs; [ lld_12 lldb cargo-tarpaulin ]);
68 { name = "HELIX_RUNTIME"; eval = "$PWD/runtime"; }
69 { name = "RUST_BACKTRACE"; value = "1"; }
70 { name = "RUSTFLAGS"; value = "-C link-arg=-fuse-ld=lld -C target-cpu=native"; }
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list