Commit 6356627
Changed files (3)
modules
secrets
modules/README.md
@@ -0,0 +1,41 @@
+# Dendrtic Pattern
+
+English | [简体中文](./README.zh-CN.md)
+
+The [Dendritic pattern][dendritic-pattern] is a way to organize Nix configurations,
+where each Nix file is a [`flake-parts`][flake-parts] module. I use the Dendritic
+pattern to combine NixOS and Home Manager configurations, avoiding the issue where
+configuration items spanning two configuration systems are located in different places.
+
+## Module Architecture
+
+| Module | Description |
+| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
+| [flake](./flake) | Modules related to `flake-parts`, including generating configuration from modules and some configuration items spanning NixOS and Home Manager |
+| [hosts](./hosts) | NixOS and Home Manager modules for all managed hosts |
+| [core](./core) | Core NixOS and Home Manager configuration modules |
+| [desktop](./desktop) | Desktop environment NixOS and Home Manager configuration modules |
+| [dev](./dev) | Development environment NixOS and Home Manager configuration modules, assumed to be for desktop |
+| [services](./services) | All NixOS modules running as services |
+| [users](./users) | NixOS modules recording all users |
+
+## Where to Start
+
+Start with the [flake module](./flake), specifically the
+[module that generates `outputs.nixosConfiguration`](./flake/gen-configuration/nixos.nix).
+Then, check each host's `./hosts/<hostname>/default.nix` to see which modules are referenced,
+and finally review each module in turn.
+
+## Anything Else?
+
+Of course! Here are some real-world Dendritic pattern NixOS configurations I have seen (listed alphabetically):
+
+- [drupol/infra)](https://github.com/drupol/infra)
+- [mightyiam/infra](https://github.com/mightyiam/infra)
+- [ShadowRZ/flakes](https://github.com/ShadowRZ/flakes)
+- [vic/vix](https://github.com/vic/vix)
+
+<!-- Links List -->
+
+[dendritic-pattern]: https://github.com/mightyiam/dendritic
+[flake-parts]: https://flake.parts/
modules/README.zh-CN.md
@@ -0,0 +1,35 @@
+# Dendritic 模式
+
+[English](./README.md) | 简体中文
+
+[Dendritic 模式][dendritic-pattern]是一种 Nix 配置组织模式,每一个 Nix 文件都是一个 [`flake-parts`][flake-parts] 模块。我使用 Dendritic 模式将 NixOS 和 Home Manager 的配置结合在一起,避免了横跨两个配置系统的配置项位于不同的位置的问题。
+
+## 模块架构
+
+| 模块 | 描述 |
+| ---------------------- | --------------------------------------------------------------------------------------- |
+| [flake](./flake) | `flake-parts` 相关的模块,包括从模块生成配置、一些横跨 NixOS 与 Home Manager 的配置项等 |
+| [hosts](./hosts) | 所有管理的主机的 NixOS 与 Home Manager 模块 |
+| [core](./core) | 核心的 NixOS 与 Home Manager 配置模块 |
+| [desktop](./desktop) | 桌面环境的 NixOS 与 Home Manager 配置模块 |
+| [dev](./dev) | 开发环境 NixOS 与 Home Manager 配置模块,假定位于桌面端 |
+| [services](./services) | 所有作为服务运行的 NixOS 模块 |
+| [users](./users) | 记录所有用户的 NixOS 模块 |
+
+## 从哪里开始
+
+从 [flake 模块](./flake) 开始,尤其是其中[生成 `outputs.nixosConfiguration` 的模块](./flake/gen-configuration/nixos.nix)。然后,检查每个主机的 `./hosts/<hostname>/default.nix` 以了解主机使用了哪些模块。最后依次查看各个被使用的模块。
+
+## 还有别的吗?
+
+当然,这里列举了一些我见过的现实中的 Dendritic 模式的 NixOS 配置(按字母顺序列出):
+
+- [drupol/infra)](https://github.com/drupol/infra)
+- [mightyiam/infra](https://github.com/mightyiam/infra)
+- [ShadowRZ/flakes](https://github.com/ShadowRZ/flakes)
+- [vic/vix](https://github.com/vic/vix)
+
+<!-- Links List -->
+
+[dendritic-pattern]: https://github.com/mightyiam/dendritic
+[flake-parts]: https://flake.parts/
secrets/README.md
@@ -0,0 +1,7 @@
+# Secrets
+
+I use [Vaultix](https://github.com/milieuim/vaultix) to manage secrets, and this folder contains the cache of automatically generated Vaultix secrets. All secrets are located within the modules that use them.
+
+## Create/Edit Secret
+
+Run `just edit_secret <SECRET_PATH>`, then run `just cache_secrets` to create secrets cache.