From 60bf1e8040d499dda93c95dd71981e678d2aa9d5 Mon Sep 17 00:00:00 2001 From: Richard Mauer Date: Sun, 29 Dec 2024 21:34:39 -0500 Subject: [PATCH] include config in initrd --- quickly.nix | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/quickly.nix b/quickly.nix index 7c61f3a..35be503 100644 --- a/quickly.nix +++ b/quickly.nix @@ -39,7 +39,25 @@ in neededForBoot = true; }; - boot.initrd.postMountCommands = '' + boot.initrd = { + + # Include your files in the initrd + includeFiles = { + # Map local files to paths in the initrd + #"/install/flake.nix" = ./install-files/flake.nix; + #"/install/configuration.nix" = ./install-files/configuration.nix; + # Add any other files you need + }; + + # Alternatively, you can include entire directories + contents = [ + { + object = ./config/initrd-include; + symlink = "/install"; + } + ]; + + postMountCommands = '' echo "Mounting initial store" ( set -eux @@ -73,9 +91,9 @@ in ) ''; - boot.initrd.availableKernelModules = [ "squashfs" "overlay" ]; - boot.initrd.kernelModules = [ "loop" "overlay" ]; - + availableKernelModules = [ "squashfs" "overlay" ]; + kernelModules = [ "loop" "overlay" ]; + }; # Create the squashfs image that contains the Nix store. system.build.squashfsStore = netbootpkgs.makeSquashfsManifest {