diff --git a/dev/docs.nix b/dev/docs.nix index d86eda092..ff1fb08e9 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}/* docs mkdocs build --strict --site-dir $out ''; docs-linkcheck = pkgs.testers.lycheeLinkCheck rec { 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 9c1aeb264..69811d4c8 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": 1721160643, + "narHash": "sha256-ZkjJnwgDUkjzgySZv9GjKnDsDmNJVkU2u2pLD4a1QKA=", + "owner": "oddlama", + "repo": "nix-topology", + "rev": "fe9ace7f40a63e3eb9b39a20a1032834e090d806", + "type": "github" + }, + "original": { + "owner": "oddlama", + "repo": "nix-topology", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1723316219, @@ -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 6e9e08ed1..b76c70c22 100644 --- a/flake.nix +++ b/flake.nix @@ -28,6 +28,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"; @@ -52,7 +57,10 @@ flake-parts.lib.mkFlake { inherit inputs; } { systems = import inputs.systems; - imports = [ inputs.treefmt-nix.flakeModule ]; + imports = [ + inputs.nix-topology.flakeModule + inputs.treefmt-nix.flakeModule + ]; perSystem = { @@ -77,8 +85,11 @@ _module.args.pkgs = import inputs.nixpkgs { inherit system; config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "terraform" ]; + overlays = [ inputs.nix-topology.overlays.default ]; }; + packages.topology = self.topology.${system}.config.output; + checks = let darwinConfigurations = lib.mapAttrs' ( 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 78cac3bd8..4ba3e4ac1 100644 --- a/modules/nixos/common/default.nix +++ b/modules/nixos/common/default.nix @@ -17,6 +17,7 @@ inputs.sops-nix.nixosModules.sops inputs.agenix.nixosModules.age inputs.srvos.nixosModules.server + inputs.nix-topology.nixosModules.default ]; # Hard-link duplicated files