update README

This commit is contained in:
Daniel Langbein 2023-09-15 10:42:28 +02:00
parent 5c4c34af86
commit 6b670253c0
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002

View File

@ -43,6 +43,8 @@ To apply the updates, continue with "Build and switch".
sudo nixos-rebuild -I nixos-config=hosts/$(hostname)/configuration.nix switch sudo nixos-rebuild -I nixos-config=hosts/$(hostname)/configuration.nix switch
``` ```
To view changes, see section "Compare two versions of NixOS system profile".
#### Option II: Build new config and activate it during next boot: #### Option II: Build new config and activate it during next boot:
```shell ```shell
@ -318,6 +320,24 @@ Excerpt of the result:
### Compare two versions of NixOS system profile ### Compare two versions of NixOS system profile
Get latest system profile. This is the profile (usually) being active after booting the system:
```shell
ls -1 /nix/var/nix/profiles/ | sort -t'-' -n -k2 | tail -n 1
#=> 120
```
Compare current with previous profile:
```shell
# https://stackoverflow.com/a/36641298
prev="$(ls -1 /nix/var/nix/profiles/ | sort -t'-' -n -k2 | tail -n 2 | head -n 1)"
curr="$(ls -1 /nix/var/nix/profiles/ | sort -t'-' -n -k2 | tail -n 1)"
nix --extra-experimental-features nix-command store diff-closures /nix/var/nix/profiles/"${prev}" /nix/var/nix/profiles/"${curr}"
```
Compare two arbitrary system profiles:
```shell ```shell
nix --extra-experimental-features nix-command store diff-closures /nix/var/nix/profiles/system-110-link /nix/var/nix/profiles/system-116-link nix --extra-experimental-features nix-command store diff-closures /nix/var/nix/profiles/system-110-link /nix/var/nix/profiles/system-116-link
``` ```