project-structure
Navigate the nix-config repository layout and find files
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Project 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 documentation
Key Files
| File | Purpose |
|---|---|
flake.nix |
Flake inputs and outputs |
flake.lock |
Locked input versions |
.sops.yaml |
SOPS encryption rules |
state.version |
NixOS state version |
lib/builders/mkSystem.nix |
Host system builder |
lib/builders/home/mkHome.nix |
Home configuration builder |
modules/nixos/default.nix |
NixOS module exports |
modules/home-manager/default.nix |
Home-Manager module exports |
pkgs/default.nix |
Custom package registry |
overlays/default.nix |
Overlay definitions |
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:
hosts/<type>/<hostname>/secrets.yamlorhome/<user>/secrets.yaml
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!