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

luarocks-nix: bumped to pass args too #140801

Merged
merged 1 commit into from
Oct 18, 2021
Merged

Conversation

teto
Copy link
Member

@teto teto commented Oct 6, 2021

Motivation for this change

Motivations are:

I am not that comfortable with fixed point in nix so not sure what I did with the newScope callPackage stuff is correct.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

- luarocks-nix: bumped to pass args too, `package_X = callPackage ...`.
  It allows to remove the annoying `with self`.
  This new version disables tests (because broken) and now emits derivation
  with a callPackage in front.
- replaced X.override with lib.overrideLuarocks, it should be used
whenever buildInputs/extraVariables is changed since it impacts the
generated luarocks config.
Once structured attributes are in, it will be easier to have the
luarocks config generated by a hook and we probably will be able to
replace all overrideLuarocks by overrideAttrs.
@teto
Copy link
Member Author

teto commented Oct 17, 2021

This updates luarocks-nix to generate packages via a scoped callPackage code like in the haskell ecosystem. It's cleaner as we dont need to rely on a with self;.
It makes overriding some arguments a bit harder though, hence the new overrideLuarocks function. Some arguments have to be overriden this way since the generation of the luarocks config needs the info. If we had structured attributes, we could geneate that config via a hook (cleaner) but until then that should do the trick.

Once this is merged, I can finally work on automating neovim lua plugins packaging.

@teto teto merged commit 253af91 into NixOS:master Oct 18, 2021
@teto teto deleted the luarocks-nix-bump branch October 18, 2021 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant