一键导入
nyx-add-module
Create a new nyx.* toggle module for the Nyx configuration. Use when adding a new feature, service, or application as a reusable toggleable module.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create a new nyx.* toggle module for the Nyx configuration. Use when adding a new feature, service, or application as a reusable toggleable module.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run the correct rebuild command for the current Nyx host. Use when the user wants to apply config changes, switch configurations, or rebuild the system. Detects platform automatically.
Add a new host to the Nyx flakes configuration. Use when the user wants to configure a new machine, add a new system, or onboard a new host to the repo.
Update Nyx flake inputs and rebuild. Use when updating nixpkgs, home-manager, hyprland, or other flake inputs to get new package versions or fixes.
| name | nyx-add-module |
| description | Create a new nyx.* toggle module for the Nyx configuration. Use when adding a new feature, service, or application as a reusable toggleable module. |
The user wants to create a new nyx.* module. Ask for:
tailscale, vscode, discordsystem/shared/modules/system/<name>/app/ — GUI applicationsdev/ — development toolsshell/ — shell/CLI toolstheme/ — themingai/ — AI toolsgaming/ — gamingdesktop/ — desktop environment components| Category | Path | Toggle namespace |
|---|---|---|
| System service | system/shared/modules/system/<name>/default.nix | nyx.modules.system.<name>.enable |
| Home app | home/shared/modules/app/<name>/default.nix | nyx.modules.app.<name>.enable |
| Home dev tool | home/shared/modules/dev/<name>/default.nix | nyx.modules.dev.<name>.enable |
| Home shell tool | home/shared/modules/shell/<name>/default.nix | nyx.modules.shell.<name>.enable |
| Home desktop | home/shared/modules/desktop/<name>/default.nix | nyx.modules.desktop.<name>.enable |
Modules are auto-discovered — any subdirectory under modules/ is automatically imported. No registration needed.
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.nyx.modules.<category>.<name>;
in
{
options.nyx.modules.<category>.<name> = {
enable = mkEnableOption "<name>";
};
config = mkIf cfg.enable {
# Your configuration here
# home.packages = with pkgs; [ <name> ];
# programs.<name>.enable = true;
};
}
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.nyx.modules.<category>.<name>;
in
{
options.nyx.modules.<category>.<name> = {
enable = mkEnableOption "<name>";
package = mkOption {
type = types.nullOr types.package;
default = pkgs.<name>;
description = "The <name> package to use. Set to null to skip package install.";
};
someOption = mkOption {
type = types.bool;
default = false;
description = "Description of what this option does.";
};
};
config = mkIf cfg.enable {
home.packages = mkIf (cfg.package != null) [ cfg.package ];
# use cfg.someOption as needed
};
}
{ config, lib, pkgs, modulesPath, hostName, ... }:
with lib;
let cfg = config.nyx.modules.system.<name>;
in
{
options.nyx.modules.system.<name> = {
enable = mkEnableOption "<name>";
};
config = mkIf cfg.enable {
services.<name>.enable = true;
environment.systemPackages = with pkgs; [ <name> ];
};
}
In any host's default.nix (NixOS/Darwin) or default.nix (Arch):
nyx.modules.<category>.<name>.enable = true;
# or with options:
nyx.modules.<category>.<name> = {
enable = true;
someOption = true;
};
mkEnableOption for the main toggle (generates a bool option with enable name and proper description)home/shared/modules/shell/starship/default.nix (simple), home/shared/modules/shell/git/default.nix (with sub-options)pkgs.stdenv.isDarwin / pkgs.stdenv.isLinuxhome/config/.config/<name>/ and referenced via xdg.configFile