Files
whc-nixos/README.md
T

66 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# whc NixOS(桌面:i7-12700F + RTX 4060)
从当前笔记本配置整理而来,按目标机拆成模块,并加上 NVIDIA 独显支持。
## 结构
```
flake.nix # nixosConfigurations.desktop
hosts/desktop/ # 主机入口 + hardware 占位
modules/
common.nix # 用户 / 网络 / PipeWire / Clash / nix
desktop-plasma.nix # Plasma 6 + SDDM
chinese.nix # 中文 locale / Fcitx5 / 字体
nvidia.nix # RTX 4060(12700F 无核显)
gaming.nix # Steam
printing.nix # CUPS + HP ULD + 中文打印
apps.nix # QQ/微信包装、开发工具等
pkgs/hp-uld-driver.nix
```
## 目标机安装(摘要)
1. 用 NixOS 安装介质启动,按官方流程分区挂载到 `/mnt`。
2. 克隆本仓库:
```bash
sudo git clone https://git.whcself.xyz/WHC/whc-nixos.git /mnt/etc/nixos
```
3. **必须**按本机磁盘重新生成硬件配置(覆盖占位 UUID):
```bash
sudo nixos-generate-config --root /mnt
# 把 /mnt/etc/nixos/hardware-configuration.nix
# 覆盖到 hosts/desktop/hardware.nix
# 或改 hosts/desktop/default.nix 去 import 生成的那份
```
4. 安装(flake):
```bash
cd /mnt/etc/nixos
sudo nixos-install --flake .#desktop
```
5. 重启后登录用户 `whc`,设密码(若安装时未设)。
已装系统上更新:
```bash
cd /etc/nixos # 或本仓库路径
sudo nixos-rebuild switch --flake .#desktop
```
## 硬件说明
| 项目 | 配置 |
|------|------|
| CPU | Intel i7-12700F → `kvm-intel`,无核显 |
| GPU | RTX 4060 → `modules/nvidia.nix`(`open = true`) |
| 桌面 | Plasma 6 + SDDM |
| 打印 | HP Laser MFP 13x ULD(不需要可从 `hosts/desktop/default.nix` 去掉 `printing.nix`) |
若 NVIDIA 黑屏:在 `modules/nvidia.nix` 把 `open = true` 改成 `false` 后重建。
## 相对原 `/etc/nixos` 的改动
- 去掉本机(Ultra 9 / Arc / 磁盘 UUID / NPU)相关硬件
- 拆模块,主机名改为 `desktop`
- 新增 RTX 4060 驱动与 `nvtop`
- 保留 QQ/微信源修复、Fcitx 包装、Clash、Steam、开发工具链