Skip to content

Commit

Permalink
flake: use builtins.fetchTree to shallow-clone grammar repos
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis committed Mar 9, 2022
1 parent a2a54cf commit 77598dd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 45 deletions.
49 changes: 15 additions & 34 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,9 @@
inputs.nixpkgs.follows = "nixpkgs";
inputs.rustOverlay.follows = "rust-overlay";
};
# NOTE: the flake looks like it is hanging when it pulls this input because
# the submodules take a long time to clone. This will be fixed in #1659.
helix = {
url = "https://github.com/helix-editor/helix.git";
type = "git";
submodules = true;
flake = false;
};
};

outputs = inputs@{ nixCargoIntegration, helix, ... }:
outputs = inputs@{ nixCargoIntegration, ... }:
nixCargoIntegration.lib.makeOutputs {
root = ./.;
renameOutputs = { "helix-term" = "helix"; };
Expand Down
5 changes: 3 additions & 2 deletions grammars.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ let
gitGrammars = builtins.filter isGitGrammar languagesConfig.grammar;
buildGrammar = grammar:
let
source = builtins.fetchGit {
source = builtins.fetchTree {
type = "git";
url = grammar.source.git;
rev = grammar.source.rev;
allRefs = true;
shallow = true;
};
in stdenv.mkDerivation rec {
# see https://github.com/NixOS/nixpkgs/blob/fbdd1a7c0bc29af5325e0d7dd70e804a972eb465/pkgs/development/tools/parsing/tree-sitter/grammar.nix
Expand Down

0 comments on commit 77598dd

Please sign in to comment.