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
Add randomizedDelaySec, persistent options to nix-gc and auto-upgrade #107805
Conversation
It should be possible to keep both apis in parallel, at least for now? |
bace3f8
to
cbdcaee
Compare
Good idea. I changed it, so if user already has set it's own dates then it will use them. But defaults are changes to work in laptop environment (and that doesn't break servers). Also updated comments a bit to indicate that dates accepts fixed date/time or intervals. And the Persistent is important to make intervals works on laptops. |
cbdcaee
to
8afc357
Compare
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.
I like the idea. I made nix-gc persistent on the side for the same reason, but it's nicer to have a proper fix. I will test both modules on my infrastructure this week.
Your commit doesn't follow CONTRIBUTING.md. Ideally, you should split it into two, namely
- nixos/nix-gc: add persistent and randomizeDelaySec options
- nixos/auto-upgrade: add persistent option
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.
Sorry for the traffic, I fumbled posting those comments apparently
I see you config:
Oh, I see I could set Persistent directly in my configuration.nix! :) I didn't know it can be so easy :) But fix it in core is definitely better, at least for users and discoverability of the configuration. Will split it to two merge requests and apply your suggested changes. |
Co-authored-by: Louis Bettens <lourkeur@users.noreply.github.com>
Co-authored-by: Louis Bettens <lourkeur@users.noreply.github.com>
Created two merge requests according to your suggestion. Closing this one. |
This reverts commit a5fec5c.
Motivation for this change
I am complaining about auto-upgrade (and nix-gc) not correctly working in laptop environment where laptop is turned on and off unpredictable causing those timers never expire and those services never executed.
Here is my proposal to fix it. Please advice, comment. Since I am changing existing API I guess it is not for direct delivery (unless it is), but I think that current situation is making those services unusable on laptops. Since it is auto upgrade that could lead to security issues as user might expect getting automatic updates while he is really not.
#15689
#75861
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)