chore(packages/schema): remove unused validation
This commit is contained in:
@@ -15,7 +15,7 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
# This function takes a list of module names and evaluates them
|
# This function takes a list of module names and evaluates them
|
||||||
# evalClanModules :: [ module ] -> { config, options, ... }
|
# [ module ] -> { config, options, ... }
|
||||||
evalClanModulesLegacy =
|
evalClanModulesLegacy =
|
||||||
modules:
|
modules:
|
||||||
let
|
let
|
||||||
@@ -30,7 +30,7 @@ let
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
# lib.warn ''
|
# 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.
|
# The following {module}/default.nix file trying to be imported.
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
./clan-app/flake-module.nix
|
./clan-app/flake-module.nix
|
||||||
./clan-vm-manager/flake-module.nix
|
./clan-vm-manager/flake-module.nix
|
||||||
./installer/flake-module.nix
|
./installer/flake-module.nix
|
||||||
./schemas/flake-module.nix
|
|
||||||
./webview-ui/flake-module.nix
|
./webview-ui/flake-module.nix
|
||||||
./distro-packages/flake-module.nix
|
./distro-packages/flake-module.nix
|
||||||
./icon-update/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