36 lines
853 B
Nix
36 lines
853 B
Nix
# tests/networkd-phobos.nix
|
|
let
|
|
system = "x86_64-linux";
|
|
|
|
# Grab nixpkgs lib for convenience
|
|
pkgs = import <nixpkgs> { inherit system; };
|
|
lib = pkgs.lib;
|
|
|
|
# Metanix world + addressing
|
|
meta = import ../meta.nix;
|
|
addressing = import ../lib/addressing { inherit lib; };
|
|
|
|
network = addressing.mkNetworkFromSpec meta;
|
|
|
|
# Fake NixOS config that your module expects
|
|
config = {
|
|
networking.hostName = "phobos";
|
|
metanix = {
|
|
thisHost = "phobos";
|
|
inherit network;
|
|
};
|
|
};
|
|
|
|
# Call the networkd module directly as a function
|
|
networkdModule = import ../modules/metanix/networkd.nix {
|
|
inherit lib config;
|
|
};
|
|
in
|
|
{
|
|
# Raw Metanix view
|
|
metanixHost = network.hosts.phobos;
|
|
metanixSubnet = network.subnets."home-main";
|
|
|
|
# What the module actually emits
|
|
systemdNetwork = networkdModule.config.systemd.network;
|
|
}
|