summary refs log tree commit diff
path: root/nixos/modules/system/boot/stage-1.nix
diff options
context:
space:
mode:
authorDanylo Hlynskyi <abcz2.uprola@gmail.com>2020-03-16 20:04:24 +0200
committerGitHub <noreply@github.com>2020-03-16 20:04:24 +0200
commitfab05f17d15e4e125def4fd4e708d205b41d8d74 (patch)
treea1ee87eea44d47e78998192d239b84fcb47da119 /nixos/modules/system/boot/stage-1.nix
parent04a0ff8cc5ce2991787960bac539799192d1b043 (diff)
parentdea79b56f7218ba75653260232c07d2f5ad2f109 (diff)
downloadnixpkgs-fab05f17d15e4e125def4fd4e708d205b41d8d74.tar
nixpkgs-fab05f17d15e4e125def4fd4e708d205b41d8d74.tar.gz
nixpkgs-fab05f17d15e4e125def4fd4e708d205b41d8d74.tar.bz2
nixpkgs-fab05f17d15e4e125def4fd4e708d205b41d8d74.tar.lz
nixpkgs-fab05f17d15e4e125def4fd4e708d205b41d8d74.tar.xz
nixpkgs-fab05f17d15e4e125def4fd4e708d205b41d8d74.tar.zst
nixpkgs-fab05f17d15e4e125def4fd4e708d205b41d8d74.zip
Merge pull request #80114 from rnhmjoj/initrd
nixos/boot: add option to disable initrd
Diffstat (limited to 'nixos/modules/system/boot/stage-1.nix')
-rw-r--r--nixos/modules/system/boot/stage-1.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix
index 26117cffeda..93cd801ef80 100644
--- a/nixos/modules/system/boot/stage-1.nix
+++ b/nixos/modules/system/boot/stage-1.nix
@@ -390,6 +390,17 @@ in
       '';
     };
 
+    boot.initrd.enable = mkOption {
+      type = types.bool;
+      default = !config.boot.isContainer;
+      defaultText = "!config.boot.isContainer";
+      description = ''
+        Whether to enable the NixOS initial RAM disk (initrd). This may be
+        needed to perform some initialisation tasks (like mounting
+        network/encrypted file systems) before continuing the boot process.
+      '';
+    };
+
     boot.initrd.prepend = mkOption {
       default = [ ];
       type = types.listOf types.str;
@@ -555,7 +566,7 @@ in
 
   };
 
-  config = mkIf (!config.boot.isContainer) {
+  config = mkIf config.boot.initrd.enable {
     assertions = [
       { assertion = any (fs: fs.mountPoint == "/") fileSystems;
         message = "The ‘fileSystems’ option does not specify your root file system.";