Skip to content

Add --extra-nixpkgs-args#577

Draft
corngood wants to merge 1 commit intoMic92:mainfrom
corngood:nixpkgs-args
Draft

Add --extra-nixpkgs-args#577
corngood wants to merge 1 commit intoMic92:mainfrom
corngood:nixpkgs-args

Conversation

@corngood
Copy link
Copy Markdown
Contributor

@corngood corngood commented Dec 5, 2025

This is my attempt at making nixpkgs args customisable. I mostly want this for testing PRs that fix cross-compilation of packages (using crossSystem).

  • Builddir now requires a Buildenv so it can init NIX_PATH in one place
  • <nixpkgs> is now a wrapper, which works in the shell, but may be confusing/breaking for people assuming that nixpkgs/ is the same thing
  • We should be able to replace most of the extra-nixpkgs-config handling by combining it with args (unless we just want to remove it)
  • It still needs more testing

Feedback would be appreciated.

Fixes: #375

allowSubstitutes = false;
dontWrapQtApps = true;
packages = if builtins.length attrs > 50 then [ env ] else attrs;
packages = [ env ];
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This sneaky change is here because it bypasses splicing. packages goes into nativeBuildInputs, which applies splicing if attrs is passed in directly. In a cross scenario we likely want the host packages.

@hatch01
Copy link
Copy Markdown
Contributor

hatch01 commented Mar 10, 2026

I may have done mostly the same as you in #608

@corngood
Copy link
Copy Markdown
Contributor Author

@hatch01 I think this one's a little more general, but yours would probably do for most of the cases I was hoping to use this for.

I can rebase this and test it, but it would be nice to get some guidance from maintainers.

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

Successfully merging this pull request may close these issues.

Considering --arg instead of --extra-nixpkgs-config

2 participants