AIFeed

NixOS 部署工具 Colmena 0.6.0 发布

Translation(model translation, not the source's own text)

你最好的 NixOS 部署工具迎来更新了!

本次发布主要包含缺陷修复,并移除了遗留的代码路径。我们计划在 0.6.x 上停留一段时间,并预计后续所有改动都将完全向后兼容。未来几个月,我们计划逐一处理所有未关闭的 issue 和 PR。如果你提交过 issue 或 PR,请测试新版本,并确认它是否仍然适用或需要 rebase。在不久的将来,我们希望带来 nix-darwin 支持(#319)、部署失败时自动回滚(#38)、分离式激活(#343)、更好的节点/标签选择器(#151)、分阶段部署(#254、#374)、纯 nixosConfigurations 支持(#60)以及更多内容。

本次发布中我们放弃了对 x86_64-darwin 的支持(跟随 nixpkgs 26.11)。Colmena 0.5.0 是最后一个支持 x86_64-darwin 的版本,并已向后移植到 nixpkgs 26.05。

在 Colmena 的 nixpkgs 打包中,我们现在在 master(NixOS/nixpkgs#597178)和 26.11/26.05(NixOS/nixpkgs#597697、NixOS/nixpkgs#597710)上直接以 pkgs.colmena.makeHive 的形式暴露 colmena.lib.makeHive。这需要 import from derivation。该想法来自 @arunoruto 的 #420。


        {
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  outputs = { nixpkgs, ... }: {
    colmenaHive = nixpkgs.legacyPackages.x86_64-linux.colmena.makeHive {
      meta.nixpkgs = import nixpkgs { system = "x86_64-linux"; };
      host-a = {
        deployment.targetHost = "host-a.example.com";
        boot.isContainer = true;
      };
    };
  };
}
      

进度指示器现在默认绘制盲文图案。该想法来自 @AgathaSorceress 的 #146。要恢复原来的时钟 emoji,请传入 --spinner emoji,或传入 --spinner ascii 使用纯 ASCII。

colmena repl 和 colmena eval --instantiate 现在可在 flake hive 上工作(#408),并且缺失的 eval 文件或在 hive 之外运行命令会报告错误,而不是 panic(#411)。以上面的示例为例:


        $ colmena eval -E '{ nodes, ... }: builtins.mapAttrs (_: n: n.config.deployment.targetHost) nodes'
{"host-a":"host-a.example.com"}
$ colmena eval --instantiate -E '{ nodes, ... }: nodes.host-a.config.system.build.toplevel'
/nix/store/5dsccavlaxv0qb4mjl8ipxi4girqlg4w-nixos-system-nixos-27.05pre-git.drv
$ colmena repl
...
Added 3 variables.
lib, nodes, pkgs
nix-repl> nodes.host-a.config.deployment.targetHost
"host-a.example.com"
      

遗留的 flake 求值方式现已被移除(#409),所有基于 flake 的配置现在必须在 outputs 中暴露 colmenaHive。旧标志 --legacy-flake-eval 和 --experimental-flake-eval 现在会作为未知参数被拒绝。与旧迁移指南相同,旧的 colmena 输出属性可以这样包装:


        colmenaHive = nixpkgs.legacyPackages.x86_64-linux.colmena.makeHive self.outputs.colmena;
      

The translation is machine-generated and individual terms may be off. Nothing is rewritten or cut; the original is authoritative.

Published by Lobsters
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗