refactor: move optional modules to modules/optional/

- Move virtualbox-guest.nix and vscode-server.nix from modules/server/ to modules/optional/
- Create modules/optional/README.md with usage docs
- Update profiles/virtualbox.nix and profiles/wsl.nix import paths
- Update modules/server/README.md to reflect removal
- Update root README.md directory tree with optional/ entry
This commit is contained in:
luochen570
2026-05-26 13:15:58 +08:00
parent e3644993ec
commit d9b2204f19
7 changed files with 39 additions and 10 deletions

View File

@@ -0,0 +1,22 @@
# 📦 modules/optional
选装模块目录——非默认启用,按需在 profile 中引用。
## 🌲 目录树
```text
📦 modules/optional
├─ 📦 virtualbox-guest.nix # VirtualBox Guest 增强(加入 wheel 组、拖拽支持)
├─ 🧠 vscode-server.nix # VS Code Server + direnv + nix-ld
└─ 📝 README.md
```
## 用法
在对应 profile 或 host 配置中添加 import
```nix
imports = [
../modules/optional/virtualbox-guest.nix
../modules/optional/vscode-server.nix
];
```

View File

@@ -0,0 +1,6 @@
{ ... }:
{
# VirtualBox Guest 增强支持
virtualisation.virtualbox.guest.enable = true;
virtualisation.virtualbox.guest.dragAndDrop = true;
}

View File

@@ -0,0 +1,13 @@
{ inputs, ... }:
{
imports = [
inputs.vscode-server.nixosModules.default
];
services.vscode-server.enable = true;
programs.direnv.enable = true;
# 允许未打补丁的动态二进制文件在 NixOS 上运行
programs.nix-ld.enable = true;
}