<aside> <img src="notion://custom_emoji/9040cc52-5c24-4c85-8328-7061a24dd7f9/1bbd969b-881f-8008-86d9-007a40b8d4f9" alt="notion://custom_emoji/9040cc52-5c24-4c85-8328-7061a24dd7f9/1bbd969b-881f-8008-86d9-007a40b8d4f9" width="40px" />

Nix + Flake 是当前流行的依赖控制方案。

Nix:https://nixos.org/

Flake

</aside>

循序渐进

背景知识

<aside> <img src="notion://custom_emoji/9040cc52-5c24-4c85-8328-7061a24dd7f9/1bbd969b-881f-8008-86d9-007a40b8d4f9" alt="notion://custom_emoji/9040cc52-5c24-4c85-8328-7061a24dd7f9/1bbd969b-881f-8008-86d9-007a40b8d4f9" width="40px" />

Some info

  1. Nix package collection(official ):https://github.com/NixOS/nixpkgs
  2. Channel status:https://status.nixos.org/←https://github.com/NixOS/nixpkgs’s tag
  3. Download & Installation:https://nixos.org/download/ </aside>

https://www.reddit.com/r/NixOS/comments/1bxa6dc/noob_question_how_to_install_software_from_github/

nix flake update --show-trace
nix develop
nix-shell -p gh
mkdir -p ~/.config/nix
echo "access-tokens = github.com=$(gh auth token)" > ~/.config/nix/nix.conf
cat ~/.config/nix/nix.conf
chmod 600 ~/.config/nix/nix.conf

这个 token 会在几小时后过期(GitHub CLI 的默认 token 有效期),如果需要长期有效的 token:

nix flake Learning