summary refs log tree commit diff
path: root/nixos/modules/system/activation
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-02-22 17:28:51 +0100
committerEelco Dolstra <edolstra@gmail.com>2018-02-22 17:28:51 +0100
commitd12c9911dfcb336243c9d13b8bc7042be3f3d4b2 (patch)
treeb689c775feef38ad8c315999e0a761dfa694eb1e /nixos/modules/system/activation
parentfab12188b855d9ac1f64f486ee38f1cf7d53c8f4 (diff)
parent186c76539855a8d1a3e76af0ff95b5de50aa48f8 (diff)
downloadnixlib-d12c9911dfcb336243c9d13b8bc7042be3f3d4b2.tar
nixlib-d12c9911dfcb336243c9d13b8bc7042be3f3d4b2.tar.gz
nixlib-d12c9911dfcb336243c9d13b8bc7042be3f3d4b2.tar.bz2
nixlib-d12c9911dfcb336243c9d13b8bc7042be3f3d4b2.tar.lz
nixlib-d12c9911dfcb336243c9d13b8bc7042be3f3d4b2.tar.xz
nixlib-d12c9911dfcb336243c9d13b8bc7042be3f3d4b2.tar.zst
nixlib-d12c9911dfcb336243c9d13b8bc7042be3f3d4b2.zip
Merge remote-tracking branch 'origin/master' into nix-2.0
Diffstat (limited to 'nixos/modules/system/activation')
-rw-r--r--nixos/modules/system/activation/top-level.nix17
1 files changed, 14 insertions, 3 deletions
diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix
index 0c50241f2edf..091a2e412eed 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
 
@@ -106,7 +108,7 @@ let
     if [] == failed then pkgs.stdenvNoCC.mkDerivation {
       name = let hn = config.networking.hostName;
                  nn = if (hn != "") then hn else "unnamed";
-          in "nixos-system-${nn}-${config.system.nixosLabel}";
+          in "nixos-system-${nn}-${config.system.nixos.label}";
       preferLocalBuild = true;
       allowSubstitutes = false;
       buildCommand = systemBuilder;
@@ -120,7 +122,7 @@ let
         config.system.build.installBootLoader
         or "echo 'Warning: do not know how to make this configuration bootable; please enable a boot loader.' 1>&2; true";
       activationScript = config.system.activationScripts.script;
-      nixosLabel = config.system.nixosLabel;
+      nixosLabel = config.system.nixos.label;
 
       configurationName = config.boot.loader.grub.configurationName;
 
@@ -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;