2018-06-17 20:50:32 +03:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
with import ./initrd-order.nix;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.mobile.boot.stage-1.loop-forever;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.mobile.boot.stage-1.loop-forever = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
2018-07-11 21:44:14 +03:00
|
|
|
default = false;
|
2018-06-17 20:50:32 +03:00
|
|
|
description = ''
|
|
|
|
Enables loop-forever.
|
|
|
|
This will "freeze" the initrd, no switch root will happen.
|
|
|
|
Enabling additional services (like `ssh`) will allow inspecting
|
|
|
|
the stage-1 phase.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config.mobile.boot.stage-1 = lib.mkIf cfg.enable {
|
2018-06-19 05:11:40 +03:00
|
|
|
init = lib.mkOrder (BEFORE_SWITCH_ROOT_INIT+1) ''
|
2018-06-18 02:57:14 +03:00
|
|
|
echo "Looping here forever..."
|
2018-06-17 20:50:32 +03:00
|
|
|
while true; do
|
|
|
|
sleep 3600
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|