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/tlp: force necessary settings #81346
Conversation
I should probably add myself to maintainers of both this module and the package 😄 I'm not sure this provides the best UX though, like what happens if someone tries to set it? |
Before: After: And yes, you should definitely add yourself :D |
@lovesegfault Right, but even before, it would say it conflicted with TLP but you had no idea why. Just that it conflicts. Now, I guess it'll just be silently ignored? |
I wouldn't say ignored, now it will silently override you and do-the-right-thing:tm: I agree that it's not ideal that it happens silently. Is there a way to add a warning like "Hey, we're preventing you from being silly, here's my soundcloud"? |
I believe assertion or warning https://nixos.org/nixos/manual/index.html#sec-assertions |
TLP is very sensitive to certain system settings that we take care to disable/nullify in the module code. This takes the further step to mkForce those options to ensure no insane behavior if the user attempts to set them in disagreement with the module.
cf8413f
to
9def8e1
Compare
Alright, done @worldofpeace, it will now scream at the user! |
@@ -37,6 +37,21 @@ in | |||
|
|||
###### implementation | |||
config = mkIf cfg.enable { | |||
warnings = with builtins.isNull; | |||
if !isNull config.powerManagement.scsiLinkPolicy then | |||
[ "You've set a non-null value for powerManagement.scsiLinkPolicy. The TLP module will override that decision." ] |
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.
This warning seems inaccurate to me.
Either the user didn't use mkForce, and the warning does not fire because the config is overriden by the module.
Or the user used something stronger than mkForce, and the "The TLP module will override that decision" part of the sentence is false.
The same applies below.
I think in this case it is better to
|
Motivation for this change
TLP is very sensitive to certain system settings that we take care to
disable/nullify in the module code. This takes the further step to
mkForce those options to ensure no insane behavior if the user attempts
to set them in disagreement with the module.
cc. @worldofpeace
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)