mirror of
https://github.com/davegallant/nix-config
synced 2026-03-03 12:46:34 +00:00
Add bootloader recovery steps
This commit is contained in:
20
README.md
20
README.md
@@ -64,3 +64,23 @@ To cleanup previous files, run nix garbage collection:
|
||||
```sh
|
||||
just clean
|
||||
```
|
||||
|
||||
## Restoring from a live USB
|
||||
|
||||
If the bootloader for some reason breaks (i.e. motherboard firmware upgrade), restore it from a live USB by running the following commands:
|
||||
|
||||
```console
|
||||
$ sudo cryptsetup luksOpen /dev/nvme0n1p2 crypted-nixos
|
||||
Enter passphrase for /dev/nvme0n1p2: ********
|
||||
$ sudo mount /dev/vg/root /mnt
|
||||
$ sudo mount /dev/nvme0n1p1 /mnt/boot/efi
|
||||
$ sudo mount /dev/vg/home /mnt/home
|
||||
$ sudo nixos-enter /mnt
|
||||
$ hostname <hostname>
|
||||
```
|
||||
|
||||
Navigate to the nix-config directory and run:
|
||||
|
||||
```sh
|
||||
just rebuild-boot
|
||||
```
|
||||
|
||||
5
justfile
5
justfile
@@ -8,7 +8,10 @@ arch := `uname -s`
|
||||
cmd := if arch == "Linux" { "nixos-rebuild --sudo" } else { "darwin-rebuild" }
|
||||
|
||||
rebuild:
|
||||
sudo $cmd switch --flake . -I nixos-config="hosts/$(hostname).nix" --show-trace
|
||||
$cmd switch --flake .
|
||||
|
||||
rebuild-boot:
|
||||
$cmd boot --flake . --install-bootloader
|
||||
|
||||
rollback:
|
||||
sudo $cmd switch --rollback --flake .
|
||||
|
||||
Reference in New Issue
Block a user