From fbc8dbb075a5c63a5c15008f05a8f9be78dff235 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Thu, 7 Apr 2022 13:21:58 +0200 Subject: [PATCH] nixos/systemd: Add onSuccess module option for units --- nixos/lib/systemd-lib.nix | 2 ++ nixos/lib/systemd-unit-options.nix | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/nixos/lib/systemd-lib.nix b/nixos/lib/systemd-lib.nix index 16ec47df3a46..779dadece582 100644 --- a/nixos/lib/systemd-lib.nix +++ b/nixos/lib/systemd-lib.nix @@ -285,6 +285,8 @@ in rec { Documentation = toString config.documentation; } // optionalAttrs (config.onFailure != []) { OnFailure = toString config.onFailure; } + // optionalAttrs (config.onSuccess != []) { + OnSuccess = toString config.onSuccess; } // optionalAttrs (options.startLimitIntervalSec.isDefined) { StartLimitIntervalSec = toString config.startLimitIntervalSec; } // optionalAttrs (options.startLimitBurst.isDefined) { diff --git a/nixos/lib/systemd-unit-options.nix b/nixos/lib/systemd-unit-options.nix index 02e91fdf1e62..d544fa5e37fc 100644 --- a/nixos/lib/systemd-unit-options.nix +++ b/nixos/lib/systemd-unit-options.nix @@ -201,6 +201,15 @@ in rec { ''; }; + onSuccess = mkOption { + default = []; + type = types.listOf unitNameType; + description = '' + A list of one or more units that are activated when + this unit enters the "inactive" state. + ''; + }; + startLimitBurst = mkOption { type = types.int; description = ''