Two years later, actually functional output.
This commit is contained in:
parent
62b4e8b80a
commit
500eb9e859
1 changed files with 31 additions and 22 deletions
|
|
@ -2,40 +2,49 @@
|
|||
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 = lib.nixosSystem {
|
||||
inherit system;
|
||||
# NixOS module system library
|
||||
nixosLib = import <nixpkgs/nixos/lib> {
|
||||
inherit lib;
|
||||
};
|
||||
|
||||
modules = [
|
||||
# Your core Metanix module (the one you moved)
|
||||
# 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
|
||||
|
||||
# The systemd-networkd integration you pasted
|
||||
# systemd-networkd integration
|
||||
../modules/metanix/networkd.nix
|
||||
|
||||
# Inline module to wire meta/addressing + identify this host
|
||||
# Local stub: "this machine is phobos"
|
||||
{
|
||||
# Metanix world & library
|
||||
inherit meta addressing;
|
||||
|
||||
# Who am I?
|
||||
networking.hostName = "phobos";
|
||||
# Optional override; here it matches hostName anyway
|
||||
metanix.thisHost = "phobos";
|
||||
|
||||
# You can also stub other things here if needed
|
||||
}
|
||||
];
|
||||
|
||||
# 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
|
||||
{
|
||||
# What we care about inspecting:
|
||||
systemdNetwork = nixos.config.systemd.network;
|
||||
metanixHost = nixos.config.metanix.network.hosts.phobos;
|
||||
metanixSubnet = nixos.config.metanix.network.subnets."home-main";
|
||||
systemdNetwork = evalResult.config.systemd.network;
|
||||
metanixHost = evalResult.config.metanix.network.hosts.phobos;
|
||||
metanixSubnet = evalResult.config.metanix.network.subnets."home-main";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue