| 27 May 2022 |
David Arnold (blaggacao) | * Zhaofeng Li: the collateral benefit to have this in-tree downstream (with hidden --eval flag):
- it's easy enough to read
- therefore, it's self documenting (the magic parts of
colmena)
| 01:31:34 |
David Arnold (blaggacao) | nixpkgs.lib.nixos.evalModules is relatively recent so inputs.nixpkgs would have to satisfy that contract, ofc. | 01:35:58 |
hexa | ❯ colmena build
[INFO ] Using configuration: /home/hexa/git/hexa/nixos-servers/config/hive.nix
[INFO ] Enumerating nodes...
error: attribute 'lib' missing
at /run/user/1000/.tmpaIJWby:388:9:
387|
388| lib = pkgs.lib;
| ^
389| reservedNames = [ "defaults" "network" "meta" ];
(use '--show-trace' to show detailed location information)
[ERROR] -----
[ERROR] Operation failed with error: Child process exited with error code: 1
| 14:59:50 |
hexa | (...) | 15:02:39 |
hexa | let
# niv sources
sources = import ../nix/sources.nix;
defaultArch = "x86_64-linux";
defaultPkgs = sources."nixos-22.05";
lib = import (defaultPkgs + "/lib");
machines = {
"foo.example.com" = {
};
"bar.example.com" = {
packages = source."nixos-21.11";
};
};
mkMachine = hostName: { system ? defaultArch, packages ? defaultPkgs, tags ? [] }:
{
imports = [
(./machines + "/${hostName}")
];
nixpkgs = {
inherit system;
};
};
in
{
meta = {
nixpkgs = defaultPkgs;
nodeNixpkgs = lib.mapAttrs
(hostName: { packages? defaultPkgs, ... }: packages)
machines;
};
} // (lib.mapAttrs mkMachine machines)
| 15:03:29 |
hexa | can anybody shed some light on that error? | 15:04:00 |
hexa | I'm slowly trying to migrate from morph, so some of the boilerplate is from that era | 15:04:27 |
Linux Hackerman | meta.nixpkgs should be an imported nixpkgs, not the path to a nixpkgs | 15:04:57 |
hexa | according to https://colmena.cli.rs/unstable/tutorial/index.html it can be … everything? | 15:05:15 |
hexa | although that may be something new from "unstable" | 15:05:25 |
hexa | {
meta = {
# Override to pin the Nixpkgs version (recommended). This option
# accepts one of the following:
# - A path to a Nixpkgs checkout
# - The Nixpkgs lambda (e.g., import <nixpkgs>)
# - An initialized Nixpkgs attribute set
nixpkgs = <nixpkgs>;
| 15:05:44 |
hexa | from the 0.3 docs | 15:06:01 |
Linux Hackerman | oh, hm. Might have been broken accidentally? | 15:06:06 |
Linux Hackerman | It definitely doesn't support passing a path when using flakes | 15:06:55 |
Linux Hackerman | Try using an imported nixpkgs anyway maybe | 15:07:31 |
hexa | passed nixpkgs = import defaultPkgs {}; | 15:08:45 |
hexa | error: attribute 'path' missing
at /run/user/1000/.tmpsGzWiX:396:26:
395| else pkgs;
396| evalConfig = import (npkgs.path + "/nixos/lib/eval-config.nix");
| ^
397| assertionModule = { config, ... }: {
(use '--show-trace' to show detailed location information)
| 15:08:50 |
hexa | fails 8 lines down, progress 😄 | 15:09:22 |
hexa | * let
# niv sources
sources = import ../nix/sources.nix;
defaultArch = "x86_64-linux";
defaultPkgs = sources."nixos-22.05";
lib = import (defaultPkgs + "/lib");
machines = {
"foo.example.com" = {
system = "aarch64-linux";
};
"bar.example.com" = {
packages = source."nixos-21.11";
};
};
mkMachine = hostName: { system ? defaultArch, packages ? defaultPkgs, tags ? [] }:
{
imports = [
(./machines + "/${hostName}")
];
nixpkgs = {
inherit system;
};
};
in
{
meta = {
nixpkgs = defaultPkgs;
nodeNixpkgs = lib.mapAttrs
(hostName: { packages? defaultPkgs, ... }: packages)
machines;
};
} // (lib.mapAttrs mkMachine machines)
| 15:10:00 |
Linux Hackerman | ok, uh, I don't know. That should have a path attr!? | 15:19:20 |
Linux Hackerman | Oh wait | 15:19:31 |
Linux Hackerman | the same applies to nodeNixpkgs. | 15:19:36 |
hexa | oh, silly me. | 15:20:21 |
hexa | yep, finally error messages that are reasonable | 15:21:39 |
hexa | oh yeah, the secrets migration is going to be great 😄 | 15:29:15 |
Zhaofeng Li | In reply to @blaggacao:matrix.org In my opinion, maintaining legacy nix support in-tree is a bit of a stretch and reduces the ability to innovate. Maby there can be a 2-tree solution that is not 100% mutually compatible . For swappable eval I'll think about it in a bit. However, support for normal Nix must be maintained in Colmena. It is flakes that is actually experimental. | 18:17:23 |
David Arnold (blaggacao) | There is a nice german word: "Deutungshoheit". | 23:51:48 |
David Arnold (blaggacao) | And that thing is shifting, and can't be contained by formalities. | 23:52:08 |
David Arnold (blaggacao) | (w.r.t. flakes 🙃) | 23:52:17 |
| 28 May 2022 |
David Arnold (blaggacao) | Zhaofeng Li: I hope this PR is comparatively uncontroversial: https://github.com/zhaofengli/colmena/pull/89 -- it's pure (hopefully) side-effect free refactoring. | 00:05:04 |