about summary refs log tree commit diff stats
path: root/sys/boot/default.nix
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-05-11 17:40:19 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-05-11 17:40:19 +0200
commite67d268f8b478199f3537cdb97eb428ede964a3c (patch)
tree8af9c0e4a372a088d931a12f285cc4751efb0b93 /sys/boot/default.nix
parentfeat(hm/conf/firefox/conf/search): Add a direct nixos github pr search (diff)
downloadnixos-config-e67d268f8b478199f3537cdb97eb428ede964a3c.tar.gz
nixos-config-e67d268f8b478199f3537cdb97eb428ede964a3c.zip
feat(sys/boot): Provide the latest arch-iso as boot target
Diffstat (limited to 'sys/boot/default.nix')
-rw-r--r--sys/boot/default.nix41
1 files changed, 31 insertions, 10 deletions
diff --git a/sys/boot/default.nix b/sys/boot/default.nix
index 9606c7b3..625394e8 100644
--- a/sys/boot/default.nix
+++ b/sys/boot/default.nix
@@ -1,8 +1,4 @@
-{
-  pkgs,
-  lib,
-  ...
-}: {
+{pkgs, ...}: {
   boot = {
     initrd = {
       #compressor = "lz4";
@@ -15,14 +11,39 @@
     lanzaboote = {
       enable = true;
       pkiBundle = "/etc/secureboot";
+
+      settings = {
+      };
     };
 
     loader = {
-      # Lanzaboote currently replaces the systemd-boot module.
-      # This setting is usually set to true in configuration.nix
-      # generated at installation time. So we force it to false
-      # for now.
-      systemd-boot.enable = lib.mkForce false;
+      systemd-boot = {
+        # Lanzaboote currently replaces the systemd-boot module.
+        # This setting is usually set to true in configuration.nix
+        # generated at installation time. So we force it to false
+        # for now.
+        enable = false;
+
+        # Disable editing the kernel command line (which could allow someone to become root)
+        editor = false;
+
+        extraEntries = {
+          "live.conf" = ''
+            title Archlinux Live ISO
+            linux /live/vmlinuz-linux
+            initrd /live/initramfs-linux.img
+            options img_loop=/archlinux.iso copytoram
+          '';
+        };
+
+        extraFiles = let
+          iso = import ./archlive_iso.nix {inherit pkgs;};
+        in {
+          "archlinux.iso" = "${iso}/archlinux.iso";
+          "live/initramfs-linux.img" = "${iso}/live/initramfs-linux.img";
+          "live/vmlinuz-linux" = "${iso}/live/vmlinuz-linux";
+        };
+      };
 
       grub = {
         enable = false;