1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2025-01-05 19:03:21 +03:00
mobile-nixos/modules/initrd-loop.nix
Samuel Dionne-Riel b5e3397783 (broken) removes initrd-order
This allows my staging area to become a bit cleaner.
2020-02-03 16:19:10 -05:00

31 lines
678 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.mobile.boot.stage-1.loop-forever;
in
{
options.mobile.boot.stage-1.loop-forever = {
enable = mkOption {
type = types.bool;
default = false;
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 {
init = lib.mkOrder (BEFORE_SWITCH_ROOT_INIT+1) ''
echo "Looping here forever..."
while true; do
sleep 3600 || break
done
'';
};
}