We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f692e14 commit 8e73648Copy full SHA for 8e73648
1 file changed
scripts/boot-nixos-generation.sh
@@ -0,0 +1,17 @@
1
+#!/usr/bin/env bash
2
+
3
+if [[ -z "$1" ]]; then
4
+ echo "Usage: boot-nixos-generation <generation-file>"
5
+ exit 1
6
+fi
7
8
+generation="$1"
9
10
+kernel="/boot/$(rg '^linux (.+\.efi)' -or '$1' $generation)"
11
+initrd="/boot/$(rg '^initrd (.+\.efi)' -or '$1' $generation)"
12
+options="$(rg '^options (.+)' -or '$1' $generation)"
13
+machine_id="$(rg '^machine-id (.+)' -or '$1' $generation)"
14
15
+options="$options systemd.machine_id=$machine_id"
16
17
+qemu-kvm -smp 2 -m 4096 -kernel "$kernel" -initrd "$initrd" -append "$options"
0 commit comments