-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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/nixosSystem: Remove deprecated arguments, deprecate pkgs argument, and add errors to specialArgs #247448
Conversation
TODO: add documentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- A bit too aggressive on the stable api.
- Secondarily: don't tolerate error conditions with just a warning.
Also seems like a good idea to finish #231940 before triggering deployment tool maintainers to look at their nixpkgs.*
situation.
++ | ||
(optional (pkgs_ != null) { | ||
_module.args.pkgs = lib.mkForce pkgs_; | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't change the behavior with just a warning, and I feel like this is too big a change anyway - as this is the stable NixOS entrypoint.
How about we start with removing pkgs
from lib.nixosSystem
? That's a weird one, where it's unclear what the intent should even be: ignore nixpkgs.*
? Use readOnlyPkgs
? I think both are equally surprising and users should make a choice (if they pass pkgs
at all).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that should either be changed to a error or added back
I think specialArgs should at least have a warning saying it can potentially be harmful
I mostly agree with you roberth Mainly put this out there to get opinions This should definitely merge after #231940 |
pkgs
to specialArgs
and lib.nixosSystem
i'll make a similar PR later |
Description of changes
passing
pkgs
tospecialArgs
andlib.nixosSystem
is a common anti-pattern that new users fall into which causes unexpected behavior and complete ignorance to thenixpkgs.
option setSince readOnlyPkgs has merged there's a easy immutable way to set
pkgs
I think it's time to do away with alternative handling methods of
pkgs
opinions are appreciated, thanks