getgrit / gritql

GritQL is a query language for searching, linting, and modifying code.
https://docs.grit.io/
MIT License
3.03k stars 71 forks source link

nixos-compatible install process #163

Open silky opened 6 months ago

silky commented 6 months ago

thanks for putting this together; it looks awesome!

unfortunately, the model of downloading binaries and running them is a moderately incompatible with nixos; it would be really nice if there was an alternative way of getting all the dependencies

some ideas:

thanks :)

morgante commented 6 months ago

Thanks for the interest! I don't have any expertise with Nix, but we'd be happy to accept a PR setting up the Nix flake.

silky commented 6 months ago

thanks for being open to it!

i've been trying with cargo2nix but getting some errors that will probably take a nix rust expert to resolve 🥲

for anyone inspired to look into it, the errors were:

          packageOverrides = pkgs: pkgs.rustBuilder.overrides.all ++ [
            (pkgs.rustBuilder.rustLib.makeOverride {
                name = "openssl-sys";
                overrideAttrs = drv: {
                  OPENSSL_NO_VENDOR = 1;
                };
            })
          ];
crate-tree-sitter-go> error: failed to parse manifest at `/build/ac098x695k1x4mc71zgvfcnzz4yy59ai-source/Cargo.toml`
crate-tree-sitter-go> 
crate-tree-sitter-go> Caused by:
crate-tree-sitter-go>   this virtual manifest specifies a [features] section, which is not allowed
crate-tree-sitter-go> /nix/store/wr08yanv2bjrphhi5aai12hf2qz5kvic-stdenv-linux/setup: line 131: pop_var_context: head of shell_variables not a function context
error: builder for '/nix/store/8jf60kk4c6k5z0js99j4mkmqgbgswdng-crate-tree-sitter-go-0.20.0.drv' failed with exit code 101;
       last 13 log lines:
       > unpacking sources
       > unpacking source archive /nix/store/njljg6dcjkarlk3b7x4v89gylzq03140-ac098x695k1x4mc71zgvfcnzz4yy59ai-source
       > source root is ac098x695k1x4mc71zgvfcnzz4yy59ai-source
       > patching sources
       > updateAutotoolsGnuConfigScriptsPhase
       > configuring
       > building
       > /nix/store/wr08yanv2bjrphhi5aai12hf2qz5kvic-stdenv-linux/setup: line 136: [: !=: unary operator expected
       > error: failed to parse manifest at `/build/ac098x695k1x4mc71zgvfcnzz4yy59ai-source/Cargo.toml`
       >
       > Caused by:
       >   this virtual manifest specifies a [features] section, which is not allowed
       > /nix/store/wr08yanv2bjrphhi5aai12hf2qz5kvic-stdenv-linux/setup: line 131: pop_var_context: head of shell_variables not a function context
       For full logs, run 'nix log /nix/store/8jf60kk4c6k5z0js99j4mkmqgbgswdng-crate-tree-sitter-go-0.20.0.drv'.

and i have no idea how to fix that.