nixos/modules: deprecation warning for StartLimitInterval in [Service]
This implements https://github.com/NixOS/nixpkgs/issues/45786#issuecomment-440091879
This commit is contained in:
@@ -892,11 +892,15 @@ in
|
|||||||
let
|
let
|
||||||
type = service.serviceConfig.Type or "";
|
type = service.serviceConfig.Type or "";
|
||||||
restart = service.serviceConfig.Restart or "no";
|
restart = service.serviceConfig.Restart or "no";
|
||||||
|
hasDeprecated = builtins.hasAttr "StartLimitInterval" service.serviceConfig;
|
||||||
in
|
in
|
||||||
concatLists [
|
concatLists [
|
||||||
(optional (type == "oneshot" && (restart == "always" || restart == "on-success"))
|
(optional (type == "oneshot" && (restart == "always" || restart == "on-success"))
|
||||||
"Service '${name}.service' with 'Type=oneshot' cannot have 'Restart=always' or 'Restart=on-success'"
|
"Service '${name}.service' with 'Type=oneshot' cannot have 'Restart=always' or 'Restart=on-success'"
|
||||||
)
|
)
|
||||||
|
(optional hasDeprecated
|
||||||
|
"Service '${name}.service' uses the attribute 'StartLimitInterval' in the Service section, which is deprecated. See https://github.com/NixOS/nixpkgs/issues/45786."
|
||||||
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
cfg.services
|
cfg.services
|
||||||
|
|||||||
Reference in New Issue
Block a user