From 711aab0bf9f502045f5201e59ac319428e00e5de Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Tue, 26 Nov 2024 11:42:16 +0100 Subject: [PATCH] add resque --- hosts/lambdaos/configuration.nix | 10 ++++++---- hosts/lambdaos/rescue.nix | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 hosts/lambdaos/rescue.nix diff --git a/hosts/lambdaos/configuration.nix b/hosts/lambdaos/configuration.nix index c39599f..36a85c3 100644 --- a/hosts/lambdaos/configuration.nix +++ b/hosts/lambdaos/configuration.nix @@ -19,6 +19,7 @@ ../../common + ./rescue.nix ./restic.nix ]; @@ -173,10 +174,11 @@ ]; xdg = { - portal = {enable = true; - extraPortals = [pkgs.xdg-desktop-portal-gnome]; - }; - }; + portal = { + enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-gnome ]; + }; + }; programs = { nm-applet.enable = true; diff --git a/hosts/lambdaos/rescue.nix b/hosts/lambdaos/rescue.nix new file mode 100644 index 0000000..781a206 --- /dev/null +++ b/hosts/lambdaos/rescue.nix @@ -0,0 +1,26 @@ +{ pkgs, ... }: +let + netboot = import (pkgs.path + "/nixos/lib/eval-config.nix") { + modules = [ + (pkgs.path + "/nixos/modules/installer/netboot/netboot-minimal.nix") + module + ]; + }; + module = { + # you will want to add options here to support your filesystem + # and also maybe ssh to let you in + boot.supportedFilesystems = [ "zfs" ]; + }; +in +{ + boot.loader.grub.extraEntries = '' + menuentry "Nixos Installer" { + linux ($drive1)/rescue-kernel init=${netboot.config.system.build.toplevel}/init ${toString netboot.config.boot.kernelParams} + initrd ($drive1)/rescue-initrd + } + ''; + boot.loader.grub.extraFiles = { + "rescue-kernel" = "${netboot.config.system.build.kernel}/bzImage"; + "rescue-initrd" = "${netboot.config.system.build.netbootRamdisk}/initrd"; + }; +}