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

Adds modifier option to developPackage #34405

Merged
merged 1 commit into from Jan 30, 2018
Merged

Conversation

pjan
Copy link

@pjan pjan commented Jan 30, 2018

Motivation for this change

developPackage uses the default haskell package settings. While the option to set (source-)overrides allows the modification of packages the derivation depends on (e.g. dontHaddock, doBenchmark, ...), these settings can't be updated for the package itself. Adding the option to pass a modifier unlocks this option.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Copy link
Member

@peti peti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the purpose of this modification. Could you please provide a concrete example that demonstrates how this extension is used?

@pjan
Copy link
Author

pjan commented Jan 30, 2018

Example of how to use it (default.nix in the root of a haskell repo):

{ pkgs ? import <nixpkgs> {} }:
  pkgs.haskellPackages.developPackage {
    root = ./.;
    modifier = pkgs.haskell.lib.doBenchmark;
  }

without it, enabling Benchmarks (example given here, but all the modifiers in pkgs.haskell.lib qualify) can't be done using the developPackage abstraction (at least not to my knowledge, so if it's possible to do it differently, I'm happy to learn how)

@peti
Copy link
Member

peti commented Jan 30, 2018

I see. Thank you for the clarification.

@peti peti merged commit ade2840 into NixOS:master Jan 30, 2018
@pjan pjan deleted the developPackage-modifier branch May 29, 2020 06:05
@expipiplus1
Copy link
Contributor

Why can't you just do doBenchmark (developPackage {...})?

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.

None yet

5 participants