I will state this disclaimer again since I have become a frequent visitor in the past couple of days: I am new to NixOS and seeking help and advice.
I would like to know common best practices for completing package updates, NixOS upgrades and garbage collection to keep the system clean. I decided to install NixOS with KDE (coming from Fedora) on my laptop and have the unstable channel added.
Here are my questions:
Package Updates
My understanding of completing package updates is to run nix-channel --update
(sudo?). Is this correct? If so, can this be included in my configuration.nix file to be scheduled to run, maybe, weekly? Or, would I use crontab to schedule that?
Keep in mind for your answer that in my particular case I would be configuring this on a laptop that is not on all the time. However, a universal answer would also be accepted as I plan to install NixOS on my desktop in the future that is on all the time, and your answer may also benefit others with various hardware.
NixOS Upgrade
My understanding of completing NixOS upgrade is to run nix-channel --upgrade
(sudo?). Is this correct? If so, is there a best practice as to when to complete a NixOS upgrade?
Garbage Collection
After watching YouTube videos and reading some documentation I understand that the system can get filled with files on your system that can be cleaned up running nix-collect-garbage
(sudo?). Is this correct? If so, what is the best practice for running this command? Also, can this be scheduled in the configuration.nix file? Or, would I use crontab?
At boot I see a long list of options to boot into which, I believe, I can revert to in case of issues. Does Garbage Collection remove these? Or, is there a separate command to delete those old entries? If there is a separate command, can I also include that in my configuration.nix file to schedule on a, maybe, monthly basis? Or, would I use crontab?
Thanks for your time and response.