Added assertions

This commit is contained in:
rasmus-kirk
2024-06-24 12:15:46 +02:00
parent ef9d27acdf
commit 8b1e2a8c1f
10 changed files with 170 additions and 19 deletions
+17 -1
View File
@@ -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 = ''