From 84292d706e417b3467bca786af51f6213b10fb30 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Wed, 6 Sep 2023 13:03:25 +0200 Subject: [PATCH] update README --- .gitignore | 3 +- README.md | 80 ++++++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 65 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 57f1cb2..1105930 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/.idea/ \ No newline at end of file +/.idea/ +/result diff --git a/README.md b/README.md index 7da3b9d..58fa373 100644 --- a/README.md +++ b/README.md @@ -17,36 +17,54 @@ During installation, select manual partitioning: * 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 -## 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://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 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 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 * 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 ``` +### 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 * https://nixos.wiki/wiki/Nix_command/repl