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
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
||||||
|
# Bring in nixpkgs and lib
|
||||||
pkgs = import <nixpkgs> { inherit system; };
|
pkgs = import <nixpkgs> { inherit system; };
|
||||||
lib = pkgs.lib;
|
lib = pkgs.lib;
|
||||||
|
|
||||||
|
# Your world + addressing lib
|
||||||
meta = import ../meta.nix;
|
meta = import ../meta.nix;
|
||||||
addressing = import ../lib/addressing { inherit lib; };
|
addressing = import ../lib/addressing { inherit lib; };
|
||||||
|
|
||||||
nixos = lib.nixosSystem {
|
# NixOS module system library
|
||||||
inherit system;
|
nixosLib = import <nixpkgs/nixos/lib> {
|
||||||
|
inherit lib;
|
||||||
|
};
|
||||||
|
|
||||||
modules = [
|
# All standard NixOS modules (as a list)
|
||||||
# Your core Metanix module (the one you moved)
|
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
|
../modules/metanix/core.nix
|
||||||
|
|
||||||
# The systemd-networkd integration you pasted
|
# systemd-networkd integration
|
||||||
../modules/metanix/networkd.nix
|
../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";
|
networking.hostName = "phobos";
|
||||||
# Optional override; here it matches hostName anyway
|
|
||||||
metanix.thisHost = "phobos";
|
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
|
in
|
||||||
{
|
{
|
||||||
# What we care about inspecting:
|
systemdNetwork = evalResult.config.systemd.network;
|
||||||
systemdNetwork = nixos.config.systemd.network;
|
metanixHost = evalResult.config.metanix.network.hosts.phobos;
|
||||||
metanixHost = nixos.config.metanix.network.hosts.phobos;
|
metanixSubnet = evalResult.config.metanix.network.subnets."home-main";
|
||||||
metanixSubnet = nixos.config.metanix.network.subnets."home-main";
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue