project-structure
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseProject Structure
项目结构
Directory Layout
目录布局
flake.nix # Top-level flake definitions
flake/
dev/ # Development shell, CI scripts, formatting
ci/ # CI-specific flake and scripts
home-manager/ # Home-Manager flake module
nixos/ # NixOS flake module
modules/ # Reusable module fragments
home-manager/ # Home-Manager specific modules
nixos/ # NixOS specific modules
lib/ # Shared Nix functions and helpers
builders/ # System and home builders (mkSystem, mkHome)
overlays/ # Nixpkgs overlays
pkgs/ # Custom packages and package sets
hosts/ # Per-machine NixOS configurations
shared/
global/ # Applied to ALL hosts
optional/ # Optional features (gaming, containers, etc.)
desktop/ # Desktop machines
shared/ # Shared across all desktops
<machine>/ # Machine-specific config
laptop/ # Laptop machines
shared/
server/ # Server machines
shared/
<machine>/
home/ # User-specific Home-Manager configurations
shared/ # Shared across all users
global/ # Applied to all users
applications/ # Application configs
desktop/ # Desktop environment configs
features/ # Feature modules (cli, etc.)
<user>/ # User-specific configs
<machine>.nix # Machine-specific overrides
os-config.nix # OS config applied to all machines
hm-config.nix # Home-Manager entry point
docs/ # Project documentationflake.nix # 顶层flake定义
flake/
dev/ # 开发Shell、CI脚本、格式化工具
ci/ # CI专用flake及脚本
home-manager/ # Home-Manager flake模块
nixos/ # NixOS flake模块
modules/ # 可复用的模块片段
home-manager/ # 专属Home-Manager的模块
nixos/ # 专属NixOS的模块
lib/ # 共享Nix函数与工具
builders/ # 系统与用户环境构建器(mkSystem、mkHome)
overlays/ # Nixpkgs覆盖层
pkgs/ # 自定义软件包与软件包集合
hosts/ # 单机器NixOS配置
shared/
global/ # 应用于所有主机
optional/ # 可选功能(游戏、容器等)
desktop/ # 桌面机器
shared/ # 所有桌面机器共享的配置
<machine>/ # 机器专属配置
laptop/ # 笔记本机器
shared/
server/ # 服务器机器
shared/
<machine>/
home/ # 专属用户的Home-Manager配置
shared/ # 所有用户共享的配置
global/ # 应用于所有用户
applications/ # 应用程序配置
desktop/ # 桌面环境配置
features/ # 功能模块(CLI等)
<user>/ # 用户专属配置
<machine>.nix # 机器专属覆盖配置
os-config.nix # 应用于所有机器的OS配置
hm-config.nix # Home-Manager入口文件
docs/ # 项目文档Key Files
关键文件
| File | Purpose |
|---|---|
| Flake inputs and outputs |
| Locked input versions |
| SOPS encryption rules |
| NixOS state version |
| Host system builder |
| Home configuration builder |
| NixOS module exports |
| Home-Manager module exports |
| Custom package registry |
| Overlay definitions |
| 文件 | 用途 |
|---|---|
| Flake输入与输出定义 |
| 锁定的输入版本 |
| SOPS加密规则 |
| NixOS状态版本 |
| 主机系统构建器 |
| 用户环境配置构建器 |
| NixOS模块导出文件 |
| Home-Manager模块导出文件 |
| 自定义软件包注册表 |
| 覆盖层定义文件 |
Finding Things
查找文件指南
- Host config:
hosts/<type>/<hostname>/default.nix - User config:
home/<username>/hm-config.nix - User on host:
home/<username>/<hostname>.nix - NixOS module:
modules/nixos/<category>/<name>.nix - HM module:
modules/home-manager/<category>/<name>.nix - Custom package:
pkgs/<package-name>/default.nix - Secrets: or
hosts/<type>/<hostname>/secrets.yamlhome/<user>/secrets.yaml
- 主机配置:
hosts/<type>/<hostname>/default.nix - 用户配置:
home/<username>/hm-config.nix - 主机上的用户配置:
home/<username>/<hostname>.nix - NixOS模块:
modules/nixos/<category>/<name>.nix - HM模块:
modules/home-manager/<category>/<name>.nix - 自定义软件包:
pkgs/<package-name>/default.nix - 机密信息:或
hosts/<type>/<hostname>/secrets.yamlhome/<user>/secrets.yaml