ITADN
edmundmiller/dotfiles
edmundmiller/dotfiles · 文件 下载 ZIP
文件最后提交记录最后更新时间
README.md
以下内容由 AI 翻译,如有问题请点此提交 issue 反馈

Made with Doom Emacs NixOS 24.11 nix-darwin

嘿, 你。你终于醒了。你之前是在尝试以声明式方式配置你的操作系统,对吧?你一头撞进了那个 NixOS 的埋伏,和我们一样,还有那边的那些 dotfiles。

好消息,旅行者! 这些 dotfiles 现在同时支持 NixOS 和 macOS。一份配置统御万物,在黑暗中将它们束缚。

# Quick taste of what you're in for:
nix run nix-darwin -- switch --flake ~/.config/dotfiles  # macOS
nixos-rebuild switch --flake .#hostname                   # NixOS

Shell:zsh + 一堆 Nix 魔法
DM:lightdm + lightdm-mini-greeter
WM:bspwm + polybar (Linux) / Aerospace (macOS)
Editor:Doom Emacs (以及 Emacs 打盹时的 nvim)
Terminal:st (Linux) / Ghostty (macOS)
Launcher:rofi (Linux) / Raycast (macOS)
Browser:firefox / Zen Browser / Orion (我收集浏览器)
GTK Theme:Ant Dracula

快速入门

NixOS?我曾经也像你一样是个冒险者……

  1. Acquire NixOS 24.11 (or close enough).
  2. Boot into the installer.
  3. Do your partitions and mount your root to /mnt (or don't, I'm not your supervisor)
  4. git clone https://github.com/emiller88/dotfiles /etc/nixos
  5. Install NixOS: nixos-install --root /mnt --flake /etc/nixos#XYZ, where XYZ is your hostname. Use #generic for a simple, universal config.
  6. OPTIONAL: Create a sub-directory in hosts/ for your device. See host/kuro as an example.
  7. Reboot!

macOS?让我猜猜,有人偷走了你的甜甜圈。

  1. Install Nix using the Determinate Systems installer (it's like the official installer, but actually works):
    curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
    Why this installer? It handles macOS quirks, enables flakes by default, and won't leave you troubleshooting for hours.
  2. git clone https://github.com/emiller88/dotfiles ~/.config/dotfiles
  3. cd ~/.config/dotfiles
  4. ./bin/hey re (or if hey isn't in your PATH yet: nix run .#darwinConfigurations.HOSTNAME.system.build.darwin-rebuild -- switch --flake .)
    • Use MacTraitor-Pro or Seqeratop for HOSTNAME, or check flake.nix for available configs
  5. Grab a coffee while Nix downloads the internet
  6. sudo ./result/sw/bin/darwin-rebuild --flake .#HOSTNAME switch when prompted

管理

我说,bin/hey怎么回事?

命令描述
hey rebuild重建此 flake(快捷键:hey re
hey upgrade更新 flake 锁文件并切换至该文件(快捷键:hey up
hey rollback回滚到上一个系统生成版本
hey gc运行 nix-collect-garbage -d。使用 sudo 清理系统配置文件
hey push REMOTE通过 ssh 将这些 dotfiles 部署到 REMOTE
hey check为此 flake 运行测试和检查
hey show显示此仓库的 flake 输出
hey skillkit-sync重新安装/重新修补 @crafter/skillkit 以支持 Amp + Pi

在 macOS 上,hey re 还会通过 Home Manager 为任何启用 modules.shell.skillkit 的主机重新应用 Skillkit 补丁。如果您手动重新安装 @crafter/skillkit,请运行 hey skillkit-sync 以恢复该补丁。

常见问题

  • How do I change the default username?

    1. Set USER the first time you run nixos-install: USER=myusername nixos-install --root /mnt --flake #XYZ
    2. Or change "emiller" in modules/options.nix (was "hlissner" in the before times).
    3. For macOS: just make sure your username matches what's in the flake
  • 我该如何“设置分区”?

我的主主机 有一个 README 你可以用作参考。 我设置了一个 EFI+GPT 系统,并使用 partedzfs 划分了分区。

macOS 用户:您可以跳过此部分并为此感到得意。

  • 为什么我的构建因 homebrew 错误而失败?

    这只是 homebrew 的常态。构建已经成功,你只需要使用 sudo 运行激活。查看 hey re 末尾的消息。

  • 为什么有 2 个 flakes?

    如果我把所有答案都放在一个方便的地方,那就不是 NixOS 的体验了。但基本上:现在一切都是 flake,抵抗是徒劳的。

作为 flake 使用

FlakeHub

将 dotfiles 添加到您的 flake.nix

{
  inputs.dotfiles.url = "https://flakehub.com/f/Emiller88/dotfiles/*.tar.gz";

  outputs = { self, dotfiles }: {
    # Use in your outputs
  };
}