Skip to content

Commit

Permalink
systemd: make ctrl-alt-del target configurable. (#16911)
Browse files Browse the repository at this point in the history
We currently only allow upstream's default of "reboot.target" due to the
way the symlinks are initialized. I made this configurable similar to the
default unit.
  • Loading branch information
Christian Kauhaus authored and fpletz committed Jul 19, 2016
1 parent a6e3a53 commit 3530f3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nixos/modules/system/boot/systemd-lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ rec {
${optionalString (type == "system") ''
# Stupid misc. symlinks.
ln -s ${cfg.defaultUnit} $out/default.target
ln -s ${cfg.ctrlAltDelUnit} $out/ctrl-alt-del.target
ln -s rescue.target $out/kbrequest.target
mkdir -p $out/getty.target.wants/
Expand Down
11 changes: 9 additions & 2 deletions nixos/modules/system/boot/systemd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ let
"systemd-poweroff.service"
"halt.target"
"systemd-halt.service"
"ctrl-alt-del.target"
"shutdown.target"
"umount.target"
"final.target"
Expand Down Expand Up @@ -162,7 +161,6 @@ let
"systemd-hostnamed.service"
"systemd-binfmt.service"
]

++ cfg.additionalUpstreamSystemUnits;

upstreamSystemWants =
Expand Down Expand Up @@ -485,6 +483,15 @@ in
description = "Default unit started when the system boots.";
};

systemd.ctrlAltDelUnit = mkOption {
default = "reboot.target";
type = types.str;
example = "poweroff.target";
description = ''
Target that should be started when Ctrl-Alt-Delete is pressed.
'';
};

systemd.globalEnvironment = mkOption {
type = types.attrs;
default = {};
Expand Down

0 comments on commit 3530f3f

Please sign in to comment.