Merge pull request 'checks.schema: fix for systems other than x86' (#142) from DavHau-clan-config into main
All checks were successful
build / test (push) Successful in 19s
All checks were successful
build / test (push) Successful in 19s
This commit is contained in:
commit
db4cca235b
@ -11,28 +11,32 @@ let
|
||||
clanLib = self.lib;
|
||||
clanModules = self.clanModules;
|
||||
|
||||
baseModule = {
|
||||
imports =
|
||||
(import (inputs.nixpkgs + "/nixos/modules/module-list.nix"))
|
||||
++ [{
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
}];
|
||||
};
|
||||
|
||||
optionsFromModule = module:
|
||||
let
|
||||
evaled = lib.evalModules {
|
||||
modules = [ module baseModule ];
|
||||
};
|
||||
in
|
||||
evaled.options.clan.networking;
|
||||
|
||||
clanModuleSchemas = mapAttrs (_: module: clanLib.jsonschema.parseOptions (optionsFromModule module)) clanModules;
|
||||
|
||||
in
|
||||
{
|
||||
perSystem = { pkgs, ... }:
|
||||
let
|
||||
baseModule = {
|
||||
imports =
|
||||
(import (inputs.nixpkgs + "/nixos/modules/module-list.nix"))
|
||||
++ [{
|
||||
nixpkgs.hostPlatform = pkgs.system;
|
||||
}];
|
||||
};
|
||||
|
||||
optionsFromModule = module:
|
||||
let
|
||||
evaled = lib.evalModules {
|
||||
modules = [ module baseModule ];
|
||||
};
|
||||
in
|
||||
evaled.options.clan.networking;
|
||||
|
||||
clanModuleSchemas =
|
||||
mapAttrs
|
||||
(_: module: clanLib.jsonschema.parseOptions (optionsFromModule module))
|
||||
clanModules;
|
||||
|
||||
mkTest = name: schema: pkgs.runCommand "schema-${name}" { } ''
|
||||
${pkgs.check-jsonschema}/bin/check-jsonschema \
|
||||
--check-metaschema ${toFile "schema-${name}" (toJSON schema)}
|
||||
|
Loading…
Reference in New Issue
Block a user