diff --git a/dev/docs.nix b/dev/docs.nix index 6fc66274f..9a814a542 100644 --- a/dev/docs.nix +++ b/dev/docs.nix @@ -18,9 +18,11 @@ ../mkdocs.yml ]; }; + inherit (config.topology.config) output; } '' - cd $files + cp --no-preserve=mode -r $files/* . + cp --no-preserve=mode -r $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..abbb2a3f4 --- /dev/null +++ b/dev/topology.nix @@ -0,0 +1,27 @@ +{ inputs, ... }: +{ + imports = [ + ({ lib, flake-parts-lib, ... }: + flake-parts-lib.mkTransposedPerSystemModule { + name = "topology"; + file = ./topology.nix; + option = lib.mkOption { + type = lib.types.unspecified; + }; + }) + ]; + + perSystem = { system, ... }: { + topology = import inputs.nix-topology { + pkgs = import inputs.nixpkgs { + inherit system; + overlays = [ + inputs.nix-topology.overlays.default + ]; + }; + modules = [ + { inherit (inputs.self) nixosConfigurations; } + ]; + }; + }; +} 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](main.svg) + +#### Network + +[network](network.svg) diff --git a/flake.lock b/flake.lock index 9dc64d40c..7e7e032c1 100644 --- a/flake.lock +++ b/flake.lock @@ -187,6 +187,35 @@ "type": "github" } }, + "nix-topology": { + "inputs": { + "devshell": [ + "empty" + ], + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ], + "pre-commit-hooks": [ + "empty" + ] + }, + "locked": { + "lastModified": 1715634843, + "narHash": "sha256-YrECYhEXY7g8Ji5luq8mdRaLRGiwTPCSDEeVP91DyDY=", + "owner": "oddlama", + "repo": "nix-topology", + "rev": "9ed5c7b5c5cd5bed9e204e8b9d69f4be1954abd3", + "type": "github" + }, + "original": { + "owner": "oddlama", + "repo": "nix-topology", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1718231705, @@ -291,6 +320,7 @@ "flake-parts": "flake-parts", "flake-utils": "flake-utils", "nix-darwin": "nix-darwin", + "nix-topology": "nix-topology", "nixpkgs": "nixpkgs", "nixpkgs-update": "nixpkgs-update", "nixpkgs-update-github-releases": "nixpkgs-update-github-releases", diff --git a/flake.nix b/flake.nix index 548831cd5..8881fd015 100644 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,11 @@ flake-utils.url = "github:numtide/flake-utils"; nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; nix-darwin.url = "github:LnL7/nix-darwin"; + 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"; nixpkgs-update-github-releases.flake = false; nixpkgs-update-github-releases.url = "github:nix-community/nixpkgs-update-github-releases"; nixpkgs-update.inputs.mmdoc.follows = "empty"; @@ -56,6 +61,7 @@ systems = import inputs.systems; imports = [ + ./dev/topology.nix inputs.treefmt-nix.flakeModule ]; diff --git a/mkdocs.yml b/mkdocs.yml index dbc5a39b6..bc19d97af 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -14,6 +14,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 91a03b29a..569b6eb0d 100644 --- a/modules/nixos/common/default.nix +++ b/modules/nixos/common/default.nix @@ -11,6 +11,7 @@ ./users.nix inputs.sops-nix.nixosModules.sops inputs.srvos.nixosModules.server + inputs.nix-topology.nixosModules.default ]; # users in trusted group are trusted by the nix-daemon