Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

常用命令

Nix 基础

命令说明
nix --version查看 Nix 版本
nix flake check检查 flake 配置
nix flake update更新所有 flake 输入
nix flake lock --update-input <name>更新特定输入
nix-collect-garbage -d删除旧 generations 并清理
nix-store --gc --print-roots查看 gc roots
nix-shell -p <pkg>临时进入含某包的 shell

Bootstrap 构建

命令说明
sh ./aarch64-darwin/build仅构建
sh ./aarch64-darwin/build-switch构建并切换
sh ./aarch64-darwin/rollback回滚配置
sh ./aarch64-darwin/apply交互式应用配置

nix-darwin

命令说明
darwin-rebuild switch --flake .#<host>切换配置
darwin-rebuild build --flake .#<host>仅构建
darwin-rebuild changelog --flake .#<host>查看更新日志

Home Manager

命令说明
home-manager switch --flake .#<user>切换用户配置
home-manager generations查看 generations
home-manager news查看更新信息

模板使用

命令说明
nix flake init -t github:BeauvnTu/Bootstrap#<template>初始化项目
nix flake init -t github:BeauvnTu/Bootstrap#denoDeno 项目
nix flake init -t github:BeauvnTu/Bootstrap#rust-wasmRust + WASM 项目

文档开发

命令说明
nix develop -c zsh进入 docs devShell
mdbook serve docs本地预览文档
mdbook build docs构建文档