gritql icon indicating copy to clipboard operation
gritql copied to clipboard

nixos-compatible install process

Open silky opened this issue 1 year ago • 3 comments

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:

  • add a flake.nix that builds the projects and all the deps
  • create a docker image with all the necessary deps so that can be a workaround
  • ???

thanks :)

silky avatar Apr 05 '24 08:04 silky

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.

morgante avatar Apr 05 '24 17:04 morgante

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:

  • it seems like cargo2nix/nix doesn't like submodules
  • i needed a sad override for openssl
          packageOverrides = pkgs: pkgs.rustBuilder.overrides.all ++ [
            (pkgs.rustBuilder.rustLib.makeOverride {
                name = "openssl-sys";
                overrideAttrs = drv: {
                  OPENSSL_NO_VENDOR = 1;
                };
            })
          ];
  • the actual error preventing the cargo2nix flake.nix example from working is:
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.

silky avatar Apr 08 '24 13:04 silky