Add a test for the location submodule: Addressing.

This commit is contained in:
Yaro Kasear 2025-11-28 18:55:16 -06:00
parent 896c5ff939
commit 9b9cfb76a9
2 changed files with 42 additions and 0 deletions

View file

@ -31,6 +31,12 @@ in
description = "System definitions from meta.nix."; description = "System definitions from meta.nix.";
}; };
policy = mkOption {
type = types.attrs;
readOnly = true;
description = "Policy subtree from meta.nix.";
};
# Computed addressing # Computed addressing
network = mkOption { network = mkOption {
type = types.attrs; type = types.attrs;

View file

@ -0,0 +1,36 @@
let
lib = import <nixpkgs/lib> { };
addressing = import ./lib/addressing { inherit lib; };
spec = {
domain = "kasear.net";
locations = {
home = {
# note: owner/admins/users are *ignored* by mkNetworkFromSpec
owner = "yaro";
admins = [ "ops" ];
main = {
vlan = 10;
hosts = {
deimos = {
role = "server";
hostId = 1;
};
router = {
role = "router";
hostId = 1;
};
};
};
};
};
};
network = addressing.mkNetworkFromSpec spec;
in
{
inherit spec network;
}