Skip to content

Commit

Permalink
feat: add nixos
Browse files Browse the repository at this point in the history
  • Loading branch information
Liassica committed Aug 18, 2024
1 parent 5bbf5ac commit 6ed2d44
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions grub2/inc-nixos.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# NixOS
function add_menu {
isofile="$1"

regexp \
--set 1:isoname \
--set 2:variant \
--set 3:version \
"^${isopath}/nixos/(nixos-([^-]+)-([0-9]+\.[0-9]+).*-([^-]+)-linux\.iso)\$" "${isofile}"
menuentry "NixOS ${version} ${variant}" "${isofile}" "${isoname}" --class nixos {
set isofile=$2
set isoname=$3
use "${isoname}"
loop $isofile
change_root (loop)
set iso_path=$isofile
export iso_path
configfile /boot/grub/loopback.cfg
restore_root
}
}

for_each_sorted add_menu "$isopath"/nixos/nixos-*-linux.iso

0 comments on commit 6ed2d44

Please sign in to comment.