chore(packages/schema): remove unused validation

This commit is contained in:
Johannes Kirschbauer
2024-11-19 17:59:30 +01:00
parent c0f25bd80c
commit ba85a8fc88
3 changed files with 2 additions and 54 deletions

View File

@@ -15,7 +15,7 @@ let
};
# This function takes a list of module names and evaluates them
# evalClanModules :: [ module ] -> { config, options, ... }
# [ module ] -> { config, options, ... }
evalClanModulesLegacy =
modules:
let
@@ -30,7 +30,7 @@ let
};
in
# lib.warn ''
# EvalClanModules doesn't respect role specific interfaces.
# doesn't respect role specific interfaces.
# The following {module}/default.nix file trying to be imported.

View File

@@ -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

View File

@@ -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
'';
};
};
}