mirror of
https://codeberg.org/privacy1st/nix-git
synced 2024-11-21 22:03:19 +01:00
update README
This commit is contained in:
parent
5c4c34af86
commit
6b670253c0
20
README.md
20
README.md
@ -43,6 +43,8 @@ To apply the updates, continue with "Build and 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:
|
||||
|
||||
```shell
|
||||
@ -318,6 +320,24 @@ Excerpt of the result:
|
||||
|
||||
### 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
|
||||
nix --extra-experimental-features nix-command store diff-closures /nix/var/nix/profiles/system-110-link /nix/var/nix/profiles/system-116-link
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user