From 28816c58685ff159fd00a8fecd0bddd4a860fd57 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Wed, 27 Sep 2023 11:09:56 +0200 Subject: [PATCH] update README --- README.md | 68 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 5e64e32..436d78e 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,14 @@ Getting the ISO: * ISO and checksum are available here: https://nixos.org/download#nixos-iso * There are unofficial torrents. If the checksum is compared with the one from the official website, these can be used as well: https://github.com/AnimMouse/NixOS-ISO-Torrents/releases -During installation, select manual partitioning: +During installation: -* 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 +* If the installation target is a SSD + * Trim the whole disk to mark all cells as unused and restore its initial performance + * `sudo blkdiscard -f /dev/nvmeXXX` +* 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 ## Update, build and switch @@ -75,31 +79,6 @@ sudo ./result/bin/switch-to-configuration switch sudo ./result/bin/switch-to-configuration boot ``` -### Failed services - -If there are e.g. file conflicts due to preexisting dotfiles, the Home Manager user service might fail. To list all failed services, run: - -```shell -systemctl --failed -``` - -## Garbage collection - -* https://nixos.org/manual/nix/stable/package-management/garbage-collection.html -* https://discourse.nixos.org/t/why-doesnt-nix-collect-garbage-remove-old-generations-from-efi-menu/17592/4 - -For all profiles: - -```shell -sudo nix-collect-garbage --delete-older-than 14d -``` - -Remove old generations from EFI: - -```shell -sudo /run/current-system/bin/switch-to-configuration boot -``` - ## niv: Dependency management * https://nix.dev/tutorials/first-steps/towards-reproducibility-pinning-nixpkgs#dependency-management-with-niv @@ -229,7 +208,9 @@ Summary: ## Automount encrypted drive -* Generate and add keyfile to LUKS device +~~* Generate and add keyfile to LUKS device~~ +* Use the same password for all attached LUKS devices to be only prompted once while booting + * https://discourse.nixos.org/t/how-to-unlock-some-luks-devices-with-a-keyfile-on-a-first-luks-device/18949/11 * luksOpen and mount drive, e.g. to `/mnt/data1` * Re-generate hardware configuration: @@ -237,7 +218,34 @@ Summary: sudo nixos-generate-config --dir hosts/$(hostname) ``` -## Run an AppImage +* If it is an SSD, enable `boot.initrd.luks.devices..allowDiscards` + +### Failed services + +If there are e.g. file conflicts due to preexisting dotfiles, the Home Manager user service might fail. To list all failed services, run: + +```shell +systemctl --failed +``` + +## Garbage collection + +* https://nixos.org/manual/nix/stable/package-management/garbage-collection.html +* https://discourse.nixos.org/t/why-doesnt-nix-collect-garbage-remove-old-generations-from-efi-menu/17592/4 + +For all profiles: + +```shell +sudo nix-collect-garbage --delete-older-than 14d +``` + +Remove old generations from EFI: + +```shell +sudo /run/current-system/bin/switch-to-configuration boot +``` + +## Run AppImages * https://nixos.wiki/wiki/Appimage