From e5184eb5d48a6c5f1d373ad8dd6baa34111add34 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Tue, 19 Nov 2024 17:59:30 +0100 Subject: [PATCH] chore(packages/schema): remove unused validation --- lib/eval-clan-modules/default.nix | 4 +-- pkgs/flake-module.nix | 1 - pkgs/schemas/flake-module.nix | 51 ------------------------------- 3 files changed, 2 insertions(+), 54 deletions(-) delete mode 100644 pkgs/schemas/flake-module.nix diff --git a/lib/eval-clan-modules/default.nix b/lib/eval-clan-modules/default.nix index cfea864f2..291a0d242 100644 --- a/lib/eval-clan-modules/default.nix +++ b/lib/eval-clan-modules/default.nix @@ -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. diff --git a/pkgs/flake-module.nix b/pkgs/flake-module.nix index 1201a52ad..940cbbc19 100644 --- a/pkgs/flake-module.nix +++ b/pkgs/flake-module.nix @@ -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 diff --git a/pkgs/schemas/flake-module.nix b/pkgs/schemas/flake-module.nix deleted file mode 100644 index 648903b5f..000000000 --- a/pkgs/schemas/flake-module.nix +++ /dev/null @@ -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 - ''; - }; - }; -}