如何让 NixOS 显示一次更新的具体内容

当 NixOS 配置好了 flake、home-manager 等等,后续的更新我们只需要运行:

 1❯ nix flake update
 2
 3❯ sudo nixos-rebuild switch
 4building the system configuration...
 5activating the configuration...
 6setting up /etc...
 7reloading user units for davinci42...
 8restarting sysinit-reactivation.target
 9the following new units were started: NetworkManager-dispatcher.service
10Done. The new configuration is /nix/store/mp17nhbadmffs9ah961ldj0y1l38a73m-nixos-system-azure-25.05.20250424.f771eb4

除了 kernel 的更新需要重启,某些环境变量需要新开 session 之外,其它 pkg 和对应的 systemd-service 应该都是最新的状态了。

Continue Reading »

Unix 中 /bin、 /sbin、 /usr/bin、 /usr/sbin 的渊源

在包括 Linux、Mac、FreeBSD 等在内的绝大多数类 Unix 系统中,根目录下会存在 /bin /sbin /usr/bin /usr/sbin 等等目录,然而却没有文档能够明确地说明这些目录的相应规则。

其实,这还得从 Ken Thompson 和 Dennis Ritchie 发明 Unix 的时候说起……

Continue Reading »