From b9291616a6d7c3747f45c7d519a4da03a17a514e Mon Sep 17 00:00:00 2001 From: Jaka Hudoklin Date: Mon, 16 Nov 2015 15:07:10 +0100 Subject: systemd module: Add OnFailure to systemd common unit options --- nixos/modules/system/boot/systemd-unit-options.nix | 9 +++++++++ nixos/modules/system/boot/systemd.nix | 2 ++ 2 files changed, 11 insertions(+) (limited to 'nixos/modules') diff --git a/nixos/modules/system/boot/systemd-unit-options.nix b/nixos/modules/system/boot/systemd-unit-options.nix index a7a334dec28..d4cab93b26b 100644 --- a/nixos/modules/system/boot/systemd-unit-options.nix +++ b/nixos/modules/system/boot/systemd-unit-options.nix @@ -170,6 +170,15 @@ in rec { ''; }; + onFailure = mkOption { + default = []; + type = types.listOf types.str; + description = '' + A list of one or more units that are activated when + this unit enters the "failed" state. + ''; + }; + }; diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 0b7647093e0..d145baeebe9 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -199,6 +199,8 @@ let { X-Restart-Triggers = toString config.restartTriggers; } // optionalAttrs (config.description != "") { Description = config.description; + } // optionalAttrs (config.onFailure != []) { + OnFailure = toString config.onFailure; }; }; }; -- cgit 1.4.1