Added assertions
This commit is contained in:
@@ -8,7 +8,16 @@ with lib; let
|
||||
nixarr = config.nixarr;
|
||||
in {
|
||||
options.nixarr.readarr = {
|
||||
enable = mkEnableOption "Enable the Readarr service";
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = ''
|
||||
Whether or not to enable the Readarr service.
|
||||
|
||||
**Required options:** [`nixarr.enable`](#nixarr.enable)
|
||||
'';
|
||||
};
|
||||
|
||||
stateDir = mkOption {
|
||||
type = types.path;
|
||||
@@ -51,6 +60,13 @@ in {
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.enable -> nixarr.enable;
|
||||
message = ''
|
||||
The nixarr.readarr.enable option requires the
|
||||
nixarr.enable option to be set, but it was not.
|
||||
'';
|
||||
}
|
||||
{
|
||||
assertion = cfg.vpn.enable -> nixarr.vpn.enable;
|
||||
message = ''
|
||||
|
||||
Reference in New Issue
Block a user