From 63a89f7d0de5fdd135801bb0bc3711cd8434b27f Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Mon, 10 Apr 2023 19:07:27 +0100 Subject: [PATCH] add config.boot.initramfs.enable --- modules/initramfs.nix | 10 ++++++++-- modules/jffs2.nix | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/initramfs.nix b/modules/initramfs.nix index c963bcf..d0668de 100644 --- a/modules/initramfs.nix +++ b/modules/initramfs.nix @@ -5,11 +5,17 @@ , ... }: let -# inherit (lib) mkOption types concatStringsSep; + inherit (lib) mkEnableOption mkIf; inherit (pkgs) runCommand callPackage writeText; in { - config = { + options = { + boot.initramfs = { + enable = mkEnableOption "enable initramfs"; + default = false; + }; + }; + config = mkIf config.boot.initramfs.enable { kernel.config.BLK_DEV_INITRD = "y"; outputs = { diff --git a/modules/jffs2.nix b/modules/jffs2.nix index ffd245d..69d6a82 100644 --- a/modules/jffs2.nix +++ b/modules/jffs2.nix @@ -12,6 +12,7 @@ in ]; config = { kernel.config.JFFS2_FS = "y"; + boot.initramfs.enable = true; outputs = rec { systemConfiguration = pkgs.pkgsBuildBuild.systemconfig config.filesystem.contents;