Commit b5b88f0
Changed files (1)
AGENTS.md
@@ -4,6 +4,37 @@ IX is a Nix configuration built with
[Dendritic Pattern](https://github.com/mightyiam/dendritic) and
[den](https://github.com/denful/den).
+## Project Structure
+
+```text
+./
+├── .secrets/ # Generated secrets for each hosts by Vaultix
+├── modules/ # All files auto imported by import-tree if not started with `_`
+│ ├── core/ # Aspects included by all hosts
+│ ├── desktop/ # Aspects only for desktop hosts
+│ ├── dev/ # Aspects only for develop hosts
+│ ├── disk/ # Aspects about file systems
+│ ├── flake-parts/ # flake-parts modules, partly out of den
+│ ├── hardware/ # Aspects about specific hardware
+│ ├── hosts/ # Declare all hosts
+│ │ ├── cyrene/ # Cloud root server
+│ │ ├── hyacine/ # Proxy server
+│ │ ├── kevin/ # Private laptop
+│ │ ├── mobius/ # Homelab root server
+│ │ ├── tribios/ # Homelab router
+│ │ └── schema.nix # Declare config schema for all hosts
+│ ├── secret/ # Aspects about secrets, powered by Vaultix
+│ ├── services/ # Aspects about services, usually provides web service
+│ ├── users/ # Declare all users
+│ │ ├── hpcesia/ # Project author, currently the only user
+│ │ ├── schema.nix # Declare config schema for all users
+│ │ └── theme.nix # User specific color-theme class
+│ ├── flake-file.nix # Declare general flake inputs, not all inputs
+│ └── mk-settings.nix # Provide `settings` from aspects to each hosts/users
+├── templates/ # Flake templates for development
+└── flake.nix # Generated by flake-file
+```
+
## Code Style
- Comments should describe why not what, code should be self documenting as to
@@ -17,20 +48,22 @@ IX is a Nix configuration built with
```sh
# Build a nixosConfiguration for specific host
+# --no-nom: disable nix output monitor, which only make sense for human
+# --diff=never: disable nix diff viewer due to poor network quality
just build <hostname> --no-nom --diff=never -- --verbose
# Regenerate flake.nix & flake.lock after modifying flake inputs by flake-file
just write-flake
-# Format all .nix and .md files by treefmt
+# Format all files by treefmt
nix fmt
# Edit and cache Vaultix secrets, need password and ONLY for human use
edit-secret <file_path> # `edit-secret` available in nix devshell
-git add <file_path> # or any command to track secret file in git
+git add <file_path> # track secret file in git
cache-secret # also in nix devshell
-git add ./.secrets # or any command to track cached secret files in git
+git add ./.secrets # track cached secret files in git
# Get path of a nix flake input
nix eval --impure --expr '(builtins.import ./default.nix).inputs.<input>.outPath'