NixOS 与 Flakes 阅读笔记 - Flakes 简介

Monday, April 29, 2024

作用:引入了一种管理 Nix 表达式之间的依赖关系的策略, 提高了 Nix 生态系统中的可复现性、可组合性和可用性。

flake.nix flake.lock

nix-command

Flakes 依赖 nix-command(New CLI).

  1. nix-channel -> 在flake.nixinputs 声明依赖包的数据源。 -> 通过 flake.lock 锁定依赖版本.
  2. nix-env 用户环境的软件包 -> nix profile.
  3. nix-shell 临时的 shell 环境 -> nix develop, nix shell, nix run.
  4. nix-build -> nix build.
  5. nix-collect-garbage nix store gc --debug
NixOSLinuxNixOSFlakes

NixOS 与 Flakes 阅读笔记 - 用 Flakes 管理 NixOS

NixOS 与 Flakes 阅读笔记 - Nix 与 NixOS 简介