aboutsummaryrefslogtreecommitdiffstats
path: root/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix31
1 files changed, 29 insertions, 2 deletions
diff --git a/default.nix b/default.nix
index 59d560e..9667ef6 100644
--- a/default.nix
+++ b/default.nix
@@ -12,6 +12,25 @@
});
})
(self: super: {
+ tree-sitter-grammars = pkgs.lib.mapAttrs
+ (name: grammar:
+ if self.lib.isDerivation grammar then
+ pkgs.stdenv.mkDerivation
+ {
+ inherit (grammar) pname version;
+ phases = [ "installPhase" ];
+ installPhase = ''
+ mkdir -p $out/lib
+ cp ${grammar}/parser $out/lib/lib${name}.so
+ '';
+ }
+ else
+ grammar
+
+ )
+ super.tree-sitter-grammars;
+ })
+ (self: super: {
anissue = pkgs.writers.writeDashBin "anissue" ''
set -efu
exec cabal run anissue -- "$@"
@@ -25,7 +44,10 @@ let
haskellPackages = pkgs.haskellPackages.override {
overrides = self: super: {
- anissue = (super.callCabal2nix "anissue" ./. { }).overrideAttrs (oldAttrs: rec {
+ anissue = (super.callCabal2nix "anissue" ./. {
+ inherit (pkgs) tree-sitter;
+ inherit (pkgs.tree-sitter-grammars) tree-sitter-haskell;
+ }).overrideAttrs (oldAttrs: rec {
nativeBuildInputs = [ pkgs.installShellFiles ];
buildInputs = oldAttrs.buildInputs or [ ] ++ [ pkgs.makeWrapper ];
passthru = oldAttrs.passthru // {
@@ -63,7 +85,12 @@ rec {
pkgs.ghcid
pkgs.haskell-language-server
pkgs.tree-sitter
- ] ++ anissue.passthru.dependencies;
+ ]
+ ++ (
+ pkgs.lib.filter pkgs.lib.isDerivation
+ (pkgs.lib.attrValues pkgs.tree-sitter-grammars)
+ )
+ ++ anissue.passthru.dependencies;
withHoogle = true;
withHaddock = true;
shellHook = ''