Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos-compatible install process #163

Open
silky opened this issue Apr 5, 2024 · 2 comments
Open

nixos-compatible install process #163

silky opened this issue Apr 5, 2024 · 2 comments

Comments

@silky
Copy link

silky commented Apr 5, 2024

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 :)

@morgante
Copy link
Contributor

morgante commented Apr 5, 2024

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
Copy link
Author

silky commented Apr 8, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants