1{ config, lib, ... }:
2
3with lib;
4
5{
6
7 ###### interface
8
9 options = {
10
11 systemd.enableEmergencyMode = mkOption {
12 default = true;
13 type = types.bool;
14 description = ''
15 Whether to enable emergency mode, which is an
16 {command}`sulogin` shell started on the console if
17 mounting a filesystem fails. Since some machines (like EC2
18 instances) have no console of any kind, emergency mode doesn't
19 make sense, and it's better to continue with the boot insofar
20 as possible.
21 '';
22 };
23
24 };
25
26 ###### implementation
27
28 config = {
29
30 systemd.additionalUpstreamSystemUnits = optionals
31 config.systemd.enableEmergencyMode [
32 "emergency.target" "emergency.service"
33 ];
34
35 };
36
37}