summary refs log tree commit diff
path: root/nixos/modules/system/activation/top-level.nix
diff options
context:
space:
mode:
authorJan Malakhovski <oxij@oxij.org>2015-11-15 00:00:00 +0000
committerJan Malakhovski <oxij@oxij.org>2018-02-18 12:56:29 +0000
commite1782e342f4c2191b9eeb5ddd5a5b36eafb9fed9 (patch)
tree8539284264b9274ad15a520a78df4e265d723a60 /nixos/modules/system/activation/top-level.nix
parentecf4825f325298e3b78665e7e6295c039dfe969f (diff)
downloadnixlib-e1782e342f4c2191b9eeb5ddd5a5b36eafb9fed9.tar
nixlib-e1782e342f4c2191b9eeb5ddd5a5b36eafb9fed9.tar.gz
nixlib-e1782e342f4c2191b9eeb5ddd5a5b36eafb9fed9.tar.bz2
nixlib-e1782e342f4c2191b9eeb5ddd5a5b36eafb9fed9.tar.lz
nixlib-e1782e342f4c2191b9eeb5ddd5a5b36eafb9fed9.tar.xz
nixlib-e1782e342f4c2191b9eeb5ddd5a5b36eafb9fed9.tar.zst
nixlib-e1782e342f4c2191b9eeb5ddd5a5b36eafb9fed9.zip
nixos: add system.boot.loader.initrdFile option and use it where appropriate
Diffstat (limited to 'nixos/modules/system/activation/top-level.nix')
-rw-r--r--nixos/modules/system/activation/top-level.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix
index 0c50241f2edf..743c146b0264 100644
--- a/nixos/modules/system/activation/top-level.nix
+++ b/nixos/modules/system/activation/top-level.nix
@@ -30,6 +30,8 @@ let
     let
       kernelPath = "${config.boot.kernelPackages.kernel}/" +
         "${config.system.boot.loader.kernelFile}";
+      initrdPath = "${config.system.build.initialRamdisk}/" +
+        "${config.system.boot.loader.initrdFile}";
     in ''
       mkdir $out
 
@@ -50,7 +52,7 @@ let
 
         echo -n "$kernelParams" > $out/kernel-params
 
-        ln -s ${config.system.build.initialRamdisk}/initrd $out/initrd
+        ln -s ${initrdPath} $out/initrd
 
         ln -s ${config.system.build.initialRamdiskSecretAppender}/bin/append-initrd-secrets $out
 
@@ -179,6 +181,15 @@ in
       '';
     };
 
+    system.boot.loader.initrdFile = mkOption {
+      internal = true;
+      default = "initrd";
+      type = types.str;
+      description = ''
+        Name of the initrd file to be passed to the bootloader.
+      '';
+    };
+
     system.copySystemConfiguration = mkOption {
       type = types.bool;
       default = false;