diff --git a/modules/system/boot/systemd-unit-options.nix b/modules/system/boot/systemd-unit-options.nix index 127ab7be3b9..46f2a705df8 100644 --- a/modules/system/boot/systemd-unit-options.nix +++ b/modules/system/boot/systemd-unit-options.nix @@ -47,6 +47,15 @@ rec { ''; }; + bindsTo = mkOption { + default = []; + types = types.listOf types.string; + description = '' + Like ‘requires’, but in addition, if the specified units + unexpectedly disappear, this unit will be stopped as well. + ''; + }; + partOf = mkOption { default = []; types = types.listOf types.string; diff --git a/modules/system/boot/systemd.nix b/modules/system/boot/systemd.nix index 6603d6126b4..268e81b1091 100644 --- a/modules/system/boot/systemd.nix +++ b/modules/system/boot/systemd.nix @@ -174,6 +174,7 @@ let Wants = concatStringsSep " " config.wants; After = concatStringsSep " " config.after; Before = concatStringsSep " " config.before; + BindsTo = concatStringsSep " " config.bindsTo; PartOf = concatStringsSep " " config.partOf; } // optionalAttrs (config.description != "") { Description = config.description;