update README

This commit is contained in:
Daniel Langbein 2023-09-06 13:03:25 +02:00
parent deff2e2cf8
commit 84292d706e
2 changed files with 65 additions and 18 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
/.idea/ /.idea/
/result

View File

@ -17,36 +17,54 @@ During installation, select manual partitioning:
* One 512MB (or larger) Fat32 partition, mounted at `/boot`, "boot" flag enabled * One 512MB (or larger) Fat32 partition, mounted at `/boot`, "boot" flag enabled
* Another partition (e.g. BTRFS) covering the rest of the drive, mounted at `/`, encryption enabled * Another partition (e.g. BTRFS) covering the rest of the drive, mounted at `/`, encryption enabled
## Build and switch ## Update, build and switch
### Update
* Updating NixOS. https://superuser.com/a/1604695
Update channel and configuration:
```shell
sudo nix-channel --update && niv update
```
To apply the updates, continue with "Build and switch".
### Build and switch
* https://nixos.wiki/wiki/Nixos-rebuild * https://nixos.wiki/wiki/Nixos-rebuild
* https://discourse.nixos.org/t/how-to-get-this-pending-updates-notification-in-gnome/16344/3
* https://discourse.nixos.org/t/how-to-get-this-pending-updates-notification-in-gnome/16344/6
Build new config, activate it and make it default: #### Option I: Build config and view changes:
```shell
# This leaves a symlink named `result` in the current directory.
sudo nixos-rebuild -I nixos-config=hosts/$(hostname)/configuration.nix build
nix --extra-experimental-features nix-command store diff-closures /run/current-system ./result
```
Depending on if there are large kernel changes, either switch to it directly or wait until next boot:
```shell
sudo ./result/bin/switch-to-configuration switch
# or
sudo ./result/bin/switch-to-configuration boot
```
#### Option II: Build new config and activate it:
```shell ```shell
sudo nixos-rebuild -I nixos-config=hosts/$(hostname)/configuration.nix switch sudo nixos-rebuild -I nixos-config=hosts/$(hostname)/configuration.nix switch
``` ```
Or activate during next boot: #### Option III: Build new config and activate it during next boot:
```shell ```shell
sudo nixos-rebuild -I nixos-config=hosts/$(hostname)/configuration.nix boot sudo nixos-rebuild -I nixos-config=hosts/$(hostname)/configuration.nix boot
``` ```
## System updates
* https://superuser.com/a/1604695
```shell
sudo nix-channel --update
```
```shell
niv update
```
Then run `nixos-rebuild switch`, see above.
## Garbage collection ## Garbage collection
* https://nixos.org/manual/nix/stable/package-management/garbage-collection.html * https://nixos.org/manual/nix/stable/package-management/garbage-collection.html
@ -231,6 +249,34 @@ Excerpt of the result:
/nix/store/jqvxmx65mfinbsm6db9kmcqmphl44xhp-nano-7.2/share/nano/autoconf.nanorc /nix/store/jqvxmx65mfinbsm6db9kmcqmphl44xhp-nano-7.2/share/nano/autoconf.nanorc
``` ```
### Compare two versions of NixOS system profile
```shell
nix --extra-experimental-features nix-command store diff-closures /nix/var/nix/profiles/system-110-link /nix/var/nix/profiles/system-116-link
```
```
cpupower: 6.1.47 → 6.1.51
element-desktop: 1.11.38 → 1.11.40, +2218.9 KiB
element-web: 1.11.38 → 1.11.40, -73.1 KiB
exempi: 2.6.3 → 2.6.4
firefox: 116.0.3 → 117.0
firefox-unwrapped: 116.0.3 → 117.0, -292.6 KiB
gnome-shell-extension-openweather: ∅ → 121, +590.5 KiB
hm_fontconfigconf.d10hmfonts.conf: ∅ → ε
initrd: ∅ → ε
initrd-linux: 6.1.47 → 6.1.51
libcap: 2.68 → 2.69
linux: 6.1.47, 6.1.47-modules → 6.1.51, 6.1.51-modules, -11.8 KiB
meld: ∅ → 3.22.0, +3858.5 KiB
net-snmp: 5.9.3 → 5.9.4
nixos-system-yodaTab: 23.05.3085.2ab91c8d65c0 → 23.05.3242.da5adce0ffaf
openjdk: +19.5 KiB
python3.10-pygobject: +27.0 KiB
stage: ∅ → 1-init.sh, +29.5 KiB
tor-browser-bundle-bin: 12.5.2 → 12.5.3, +18.1 KiB
user: +2885.0 KiB
```
### NixOS configuration debugging ### NixOS configuration debugging
* https://nixos.wiki/wiki/Nix_command/repl * https://nixos.wiki/wiki/Nix_command/repl