chore(packages/schema): remove unused validation
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
./clan-app/flake-module.nix
|
||||
./clan-vm-manager/flake-module.nix
|
||||
./installer/flake-module.nix
|
||||
./schemas/flake-module.nix
|
||||
./webview-ui/flake-module.nix
|
||||
./distro-packages/flake-module.nix
|
||||
./icon-update/flake-module.nix
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
{ self, ... }:
|
||||
{
|
||||
perSystem =
|
||||
{ pkgs, lib, ... }:
|
||||
let
|
||||
clanModules = self.clanModules;
|
||||
|
||||
jsonLib = self.lib.jsonschema { };
|
||||
|
||||
# Uncomment if you only want one module to be available
|
||||
# clanModules = {
|
||||
# borgbackup = self.clanModules.borgbackup;
|
||||
# };
|
||||
|
||||
optionsFromModule = name: module: (self.lib.evalClanModules [ module ]).options.clan.${name} or { };
|
||||
|
||||
clanModuleSchemas = lib.mapAttrs (
|
||||
name: module: jsonLib.parseOptions (optionsFromModule name module) { }
|
||||
) clanModules;
|
||||
|
||||
clanModuleFunctionSchemas = lib.attrsets.mapAttrsToList (
|
||||
modulename: module:
|
||||
(self.lib.modules.getFrontmatter modulename)
|
||||
// {
|
||||
name = modulename;
|
||||
parameters = jsonLib.parseOptions (optionsFromModule modulename module) { };
|
||||
}
|
||||
) clanModules;
|
||||
in
|
||||
rec {
|
||||
checks = {
|
||||
module-schema = pkgs.runCommand "schema-checks" { } ''
|
||||
${pkgs.check-jsonschema}/bin/check-jsonschema \
|
||||
--check-metaschema ${packages.module-schema}
|
||||
touch $out
|
||||
'';
|
||||
};
|
||||
|
||||
packages = {
|
||||
module-schema = pkgs.runCommand "jsonschema" { } ''
|
||||
MSCHEMA=${builtins.toFile "module-schemas.json" (builtins.toJSON clanModuleSchemas)}
|
||||
cp "$MSCHEMA" $out
|
||||
'';
|
||||
|
||||
function-schema = pkgs.runCommand "function-schema" { } ''
|
||||
FSCHEMA=${builtins.toFile "function-schemas.json" (builtins.toJSON clanModuleFunctionSchemas)}
|
||||
cp "$FSCHEMA" $out
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user