Migrate update to own package

This commit is contained in:
Daniel Siepmann 2022-02-14 08:05:09 +01:00
parent 2cdb96acc6
commit 000b52cced
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
3 changed files with 24 additions and 13 deletions

View file

@ -36,6 +36,7 @@
pkgs.dmenu
pkgs.networkmanager_dmenu
pkgs.dmenu-custom-scripts
pkgs.custom-update-system
pkgs.dunst
pkgs.st
pkgs.ncdu

View file

@ -0,0 +1,21 @@
self: super:
{
custom-update-system = super.pkgs.writeShellApplication {
name = "custom-update-system";
runtimeInputs = [
super.pkgs.nix
super.pkgs.home-manager
];
text = ''
nix-channel --update
home-manager switch
home-manager expire-generations '-30 days'
nix-env --delete-generations +5
nix store gc
nix store optimise
'';
};
}

View file

@ -65,19 +65,8 @@ It has the following sub folder:
Update
------
The following will update the whole system and clean things up:
nix-channel --update \
&& home-manager switch \
&& home-manager expire-generations '-30 days' \
&& nix-env --delete-generations +5 \
&& nix store gc \
&& nix store optimise
This will update the channel (fetch state of nixpkgs).
It then will update system.
Delete old generations.
And run garbage collection.
Update can be done via `custom-update-system` package which is available within
the overlay.
Manual changes
--------------