Add jsonschema test case
This commit is contained in:
parent
83ea2312a1
commit
159198b81a
|
@ -10,5 +10,10 @@
|
|||
},
|
||||
"services": {
|
||||
"opt": "this option doesn't make sense"
|
||||
},
|
||||
"destinations": {
|
||||
"test-backup": {
|
||||
"name": "John Doe"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,5 +50,26 @@
|
|||
];
|
||||
description = "A list of enabled kernel modules";
|
||||
};
|
||||
destinations = lib.mkOption {
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.submodule (
|
||||
{ name, ... }:
|
||||
{
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.strMatching "^[a-zA-Z0-9._-]+$";
|
||||
default = name;
|
||||
description = "the name of the backup job";
|
||||
};
|
||||
repo = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "the borgbackup repository to backup to";
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
);
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -45,6 +45,27 @@
|
|||
"description": "A submodule option"
|
||||
}
|
||||
}
|
||||
},
|
||||
"destinations": {
|
||||
"additionalProperties": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"default": "‹name›",
|
||||
"description": "the name of the backup job",
|
||||
"type": "string"
|
||||
},
|
||||
"repo": {
|
||||
"description": "the borgbackup repository to backup to",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"repo"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"default": {},
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
checks = {
|
||||
module-schema = pkgs.runCommand "schema-checks" { } ''
|
||||
${pkgs.check-jsonschema}/bin/check-jsonschema \
|
||||
--check-metaschema --fill-defaults ${packages.module-schema}
|
||||
--check-metaschema ${packages.module-schema}
|
||||
touch $out
|
||||
'';
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user