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

Advice on overriding openssl version? #47

Closed
will opened this issue Jan 18, 2023 · 2 comments
Closed

Advice on overriding openssl version? #47

will opened this issue Jan 18, 2023 · 2 comments

Comments

@will
Copy link
Contributor

will commented Jan 18, 2023

This is maybe related to #6, but I didn't want to hijack the discussion there.

I need to drop back down to openssl 1.1 for the time being. So far I've figured out two ways to do it. First was to make a branch on my fork of this project and change the override predicate to always return true. This was easy, but for sure not the right way.

I finally figured one way to do it with overrideAttrs, but it's feels kind of gross to need to use lists.remove

ruby = nixpkgs-ruby.packages.${system}."ruby-${rubyVersion}".overrideAttrs (finalAttrs: previousAttrs: {
  buildInputs = pkgs.lib.lists.remove pkgs.openssl (previousAttrs.buildInputs ++ [ pkgs.openssl_1_1 ]);
});

rubyEnv = pkgs.bundlerEnv {
  inherit ruby;
  # ...

I have to imagine there is a more proper way to pass in openssl_1_1 since openssl is an argument to packageFn, but I can't figure out where to pass that in.

@bobvanderlinden
Copy link
Owner

You should be able to use the following:

nixpkgs-ruby.packages.${system}."ruby-${rubyVersion}".override { openssl = pkgs.openssl_1_1; }

The Ruby packages have several supported package options, which you can set using override. overrideAttrs is only needed when you want to change something in the derivation that isn't supported by those options.

I once wrote a blog post about customizing Nix packages, this section is about override vs overrideAttrs: https://bobvanderlinden.me/customizing-packages-in-nix/#modification-methods

@will
Copy link
Contributor Author

will commented Jan 26, 2023

Thanks this worked!

@will will closed this as completed Jan 26, 2023
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