diff --git a/dev/docs.nix b/dev/docs.nix
index d86eda092..30443575b 100644
--- a/dev/docs.nix
+++ b/dev/docs.nix
@@ -15,7 +15,8 @@
};
}
''
- cd $files
+ cp --no-preserve=mode -r $files/* .
+ cp --no-preserve=mode -r ${config.packages.topology-output}/* docs
mkdocs build --strict --site-dir $out
'';
docs-linkcheck = pkgs.testers.lycheeLinkCheck rec {
diff --git a/dev/topology.nix b/dev/topology.nix
new file mode 100644
index 000000000..e336a99c5
--- /dev/null
+++ b/dev/topology.nix
@@ -0,0 +1,22 @@
+{ self, ... }:
+{
+ perSystem =
+ { system, ... }:
+ {
+ topology.modules = [
+ {
+ nodes = {
+ darwin01 = {
+ name = "darwin01";
+ deviceType = "nixos";
+ };
+ darwin02 = {
+ name = "darwin02";
+ deviceType = "nixos";
+ };
+ };
+ }
+ ];
+ packages.topology-output = self.topology.${system}.config.output;
+ };
+}
diff --git a/docs/hosts.md b/docs/hosts.md
new file mode 100644
index 000000000..53f77f76f
--- /dev/null
+++ b/docs/hosts.md
@@ -0,0 +1,7 @@
+#### Main
+
+[](main.svg)
+
+#### Network
+
+[](network.svg)
diff --git a/flake.lock b/flake.lock
index 08f8875e0..564f4bd43 100644
--- a/flake.lock
+++ b/flake.lock
@@ -260,6 +260,35 @@
"type": "github"
}
},
+ "nix-topology": {
+ "inputs": {
+ "devshell": [
+ "empty"
+ ],
+ "flake-utils": [
+ "flake-utils"
+ ],
+ "nixpkgs": [
+ "nixpkgs"
+ ],
+ "pre-commit-hooks": [
+ "empty"
+ ]
+ },
+ "locked": {
+ "lastModified": 1725483443,
+ "narHash": "sha256-WzOlGMKV/51Fccn/OMHcm5yrqgbOJZrJIy1ya4pW0u8=",
+ "owner": "oddlama",
+ "repo": "nix-topology",
+ "rev": "8738d94670265beb166954c4e3a26e432f79f68c",
+ "type": "github"
+ },
+ "original": {
+ "owner": "oddlama",
+ "repo": "nix-topology",
+ "type": "github"
+ }
+ },
"nixos-facter-modules": {
"locked": {
"lastModified": 1728570174,
@@ -383,6 +412,7 @@
"lite-config": "lite-config",
"nix-darwin": "nix-darwin",
"nix-index-database": "nix-index-database",
+ "nix-topology": "nix-topology",
"nixos-facter-modules": "nixos-facter-modules",
"nixpkgs": "nixpkgs",
"nixpkgs-update": "nixpkgs-update",
diff --git a/flake.nix b/flake.nix
index 2fa496bb9..46e34d767 100644
--- a/flake.nix
+++ b/flake.nix
@@ -36,6 +36,11 @@
nix-darwin.url = "github:LnL7/nix-darwin";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
nix-index-database.url = "github:nix-community/nix-index-database";
+ nix-topology.inputs.devshell.follows = "empty";
+ nix-topology.inputs.flake-utils.follows = "flake-utils";
+ nix-topology.inputs.nixpkgs.follows = "nixpkgs";
+ nix-topology.inputs.pre-commit-hooks.follows = "empty";
+ nix-topology.url = "github:oddlama/nix-topology";
nixos-facter-modules.url = "github:numtide/nixos-facter-modules";
nixpkgs-update-github-releases.flake = false;
nixpkgs-update-github-releases.url = "github:nix-community/nixpkgs-update-github-releases";
@@ -62,7 +67,9 @@
systems = import inputs.systems;
imports = [
+ ./dev/topology.nix
inputs.lite-config.flakeModule
+ inputs.nix-topology.flakeModule
inputs.treefmt-nix.flakeModule
];
diff --git a/mkdocs.yml b/mkdocs.yml
index 926f16f54..b1e070d6b 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -16,6 +16,7 @@ nav:
- FAQ: faq.md
- administrators.md
- contact.md
+ - hosts.md
- security.md
theme:
diff --git a/modules/nixos/common/default.nix b/modules/nixos/common/default.nix
index 6a01d5ed5..21954fa85 100644
--- a/modules/nixos/common/default.nix
+++ b/modules/nixos/common/default.nix
@@ -15,6 +15,7 @@
./update.nix
./users.nix
inputs.srvos.nixosModules.server
+ inputs.nix-topology.nixosModules.default
];
# Hard-link duplicated files