Maintain nix itself with home-manager

This commit is contained in:
Daniel Siepmann 2022-02-02 17:40:23 +01:00
parent b096d6b0db
commit 11912bef9a
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
2 changed files with 8 additions and 9 deletions

View file

@ -20,6 +20,8 @@
programs.home-manager.enable = true;
home.packages = [
pkgs.nix
# System tools
pkgs.dmenu
pkgs.st

View file

@ -36,15 +36,12 @@ Update
The following will update the whole system and clean things up::
nix-channel --update \
&& nix-env -ia nixpkgs.nix nixpkgs.cacert \
&& home-manager switch \
&& home-manager expire-generations '-30 days' \
&& nix-env --delete-generations +5 \
&& nix-store --gc
nix-channel --update \
&& home-manager switch \
&& home-manager expire-generations '-30 days' \
&& nix-store --gc
This will update the channel (fetch state of nixpkgs).
It then will update nix itself.
Then upgrade all installed derivations (packages).
Delete old generations, except last 5.
It then will update system.
Delete old generations.
And run garbage collection.