update README

This commit is contained in:
Daniel Langbein 2023-09-27 11:09:56 +02:00
parent 0914482a61
commit 28816c5868
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002

View File

@ -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.<name>.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