diff options
Diffstat (limited to 'nixos/modules/system/activation/top-level.nix')
-rw-r--r-- | nixos/modules/system/activation/top-level.nix | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix index a560af5ce96d..4bee55d80fbb 100644 --- a/nixos/modules/system/activation/top-level.nix +++ b/nixos/modules/system/activation/top-level.nix @@ -52,6 +52,20 @@ let echo -n "$kernelParams" > $out/kernel-params + ln -s ${ + + pkgs.makeInitrd { + contents = [ + { symlink = "init"; + object = pkgs.writeScript "init" '' + echo hello world + ''; + } + ]; + } + + }/${config.system.boot.loader.initrdFile} $out/s6-initrd + ln -s ${initrdPath} $out/initrd ln -s ${config.system.build.initialRamdiskSecretAppender}/bin/append-initrd-secrets $out @@ -65,6 +79,30 @@ let unset activationScript cp ${config.system.build.bootStage2} $out/init + + ${pkgs.s6-linux-init}/bin/s6-linux-init-maker \ + -G "${pkgs.utillinux}/bin/agetty --noclear 38400 tty1" \ + -c $out/s6 \ + -b ${pkgs.execline.bin}/bin \ + -p ${lib.makeBinPath (with pkgs; [ execline s6 s6-portable-utils s6-linux-utils s6-linux-init ])} \ + -s /run/kernel-env \ + -2 $out/s6/rc.init \ + -Z ${pkgs.writeScript "shutdown" '' + #!${pkgs.execline}/bin/execlineb -P + echo alyssa shutting down + ''} \ + $out/s6 + sed -i '9aif { ${pkgs.coreutils}/bin/mkfifo -m 600 /run/service/s6-svscan-log/fifo }' "$out/s6/init" + rm $out/s6/run-image/service/s6-svscan-log/fifo + + cat <<RC >$out/s6/rc.init + #!${pkgs.execline}/bin/execlineb -P + if { $out/activate } + if { ${config.s6.rc.initCommand} } + ${config.s6.rc.command} + RC + chmod +x $out/s6/rc.init + substituteInPlace $out/init --subst-var-by systemConfig $out ln -s ${config.system.build.etc}/etc $out/etc |