Repository navigation
attribute 'deprecationMessage' missing when using den.lib.schema.mkInstanceRegistry
#766
Answered
by
sini
AlexLov
asked this question in
Help - Issues / Problem Solving / How To
|
Hi, I'm trying to extend Below is the bogus test which shows the error, I managed to narrow the issue to Could anyone help with this? The error: Test code: { denTest, ... }:
let
hostOpt = { lib, ... }: {
options = {
backendKind = lib.mkOption {
type = lib.types.enum [ "container" "node" ];
default = "node";
description = "Where to add the host on runNixOSTest: to containers or nodes";
};
};
};
in
{
flake.tests.bogus = {
test-mkInstanceRegistry-in-runNixOSTest = denTest (
{
den,
lib,
inputs,
...
}:
let
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
denHostsModule = {
options.denHosts = lib.mkOption {
default = { };
type = den.lib.schema.mkInstanceRegistry {
strict = den.schema.host.isStrict;
extraModules = [ hostOpt ];
} den.schema.host;
};
};
nixTest = pkgs.testers.runNixOSTest {
imports = [ denHostsModule ];
denHosts.machine = {};
};
in
{
expr = nixTest.config.denHosts.machine.backendKind;
expected = "node";
}
);
test-extended-runNixOSTest = denTest (
{
lib,
inputs,
...
}:
let
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
denHostsModule = {
options.denHosts = lib.mkOption {
default = { };
type = lib.types.attrsOf (lib.types.submodule hostOpt);
};
};
nixTest = pkgs.testers.runNixOSTest {
imports = [ denHostsModule ];
denHosts.machine = {};
};
in
{
expr = nixTest.config.denHosts.machine.backendKind;
expected = "node";
}
);
test-default-runNixOSTest = denTest (
{
inputs,
...
}:
let
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
nixTest = pkgs.testers.runNixOSTest {
nodes.machine = {};
};
in
{
expr = nixTest.config.nodes.machine.networking.hostName;
expected = "machine";
}
);
};
} |
Answered by
sini
Nov 13, 2026
Replies: 1 comment 8 replies
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Quick follow-up on the error itself -- it's now tracked internally, and here's what's actually going on.
The bare registry form fails because nothing hands your module a
lib. nixpkgs'evalModulesalways passeslib(along withspecialArgsand_prefix) to every module. gen-merge, the module engine den evaluates schemas with, doesn't pass it at any level; a module only getslibif the caller puts it inspecialArgs. den'smkInstanceTypewrapper does that for you, which is why the type form works, whilemkInstanceRegistrycomes straight from gen-schema without the wrapper.The message makes it worse. Because your module asked for an argument while it was declaring options, gen-merge's guard ag…