50 lines
1.3 KiB
Nix
50 lines
1.3 KiB
Nix
# tests/networkd-phobos.nix
|
|
let
|
|
system = "x86_64-linux";
|
|
|
|
# Bring in nixpkgs and lib
|
|
pkgs = import <nixpkgs> { inherit system; };
|
|
lib = pkgs.lib;
|
|
|
|
# Your world + addressing lib
|
|
meta = import ../meta.nix;
|
|
addressing = import ../lib/addressing { inherit lib; };
|
|
|
|
# NixOS module system library
|
|
nixosLib = import <nixpkgs/nixos/lib> {
|
|
inherit lib;
|
|
};
|
|
|
|
# All standard NixOS modules (as a list)
|
|
baseModules = import <nixpkgs/nixos/modules/module-list.nix>;
|
|
|
|
# Evaluate modules as if this were a NixOS system
|
|
evalResult = nixosLib.evalModules {
|
|
modules =
|
|
baseModules
|
|
++ [
|
|
# Metanix core wiring (meta + addressing)
|
|
../modules/metanix/core.nix
|
|
|
|
# systemd-networkd integration
|
|
../modules/metanix/networkd.nix
|
|
|
|
# Local stub: "this machine is phobos"
|
|
{
|
|
networking.hostName = "phobos";
|
|
metanix.thisHost = "phobos";
|
|
}
|
|
];
|
|
|
|
# Args passed to all modules: { lib, pkgs, system, meta, addressing, modulesPath, ... }
|
|
specialArgs = {
|
|
inherit lib pkgs system meta addressing;
|
|
modulesPath = builtins.toString <nixpkgs/nixos/modules>;
|
|
};
|
|
};
|
|
in
|
|
{
|
|
systemdNetwork = evalResult.config.systemd.network;
|
|
metanixHost = evalResult.config.metanix.network.hosts.phobos;
|
|
metanixSubnet = evalResult.config.metanix.network.subnets."home-main";
|
|
}
|