!UKDpaKNNsBpOPfLWfX:zhaofeng.li

Colmena

311 Members
A simple, stateless NixOS deployment tool - https://github.com/zhaofengli/colmena110 Servers

Load older messages


SenderMessageTime
22 Feb 2022
@schnecfk:ruhr-uni-bochum.deCRTified
In reply to @n0emis:noemis.me
Is there a easy way to acces the merged nixos-config, e.g. to build a vm with it (via nixos-rebuild build-vm or something like it)?
In the end, you "just" need to evaluate the configuration and get the derivation at the attribute path config.system.build.vm from that evaluation 🙂
15:45:21
@schnecfk:ruhr-uni-bochum.deCRTifiedAs far as I can tell, it's easier with flakes if you use a helper function as I've documented here: https://github.com/zhaofengli/colmena/issues/60#issuecomment-104719955115:46:11
@schnecfk:ruhr-uni-bochum.deCRTified If you do so, you can access the evaluated configuration within the packages output of the flake - for example, you can reference self.nixosConfigurations.HOSTNAME.config.system.build.vm and add it to the packages attrset 15:47:10
@schnecfk:ruhr-uni-bochum.deCRTified * If you do so, you can access the evaluated configuration within the packages output of the flake - for example, you can reference self.nixosConfigurations.HOSTNAME.config.system.build.vm and add it to the packages attrset (I'm doing something similar to build aarch64 sd-images) 15:47:36
@schnecfk:ruhr-uni-bochum.deCRTifiedFor non-flakes configs, you could just eval-config and get that attribute out of the result, check https://github.com/NixOS/nixpkgs/blob/master/nixos/lib/eval-config.nix for that. But that's probably a bit out of scope for the colmena channel, as it only relies on nixpkgs 🙂15:56:08
23 Feb 2022
@github:maunium.net@github:maunium.net [zhaofengli/colmena] utsl42 opened issue #61: override deployment.targetUser in CLI

Could we have a CLI argument or environment variable to override the deployment.targetUser? Useful in cases where the remote user isn't the same, but someone else might need to use a different username to deploy, so setting it in the Nix configuration isn't helpful.

19:42:46
2 Mar 2022
@phaer:matrix.orgphaer set a profile picture.13:09:06
@phaer:matrix.orgphaer changed their display name from phaer to Paul Haerle.13:09:24
6 Mar 2022
@winterqt:nixos.devWinter (she/her) there's no way to parallelize/improve the efficiency of the copying path ... to ... stage when using buildOnTarget, right? 18:42:57
@winterqt:nixos.devWinter (she/her)upgrading unstable for the first time in over a month and these node.js deps are killing me 😅18:44:15
@winterqt:nixos.devWinter (she/her)oh i guess my pam mass rebuild situation didn't make things any better, heh...18:45:53
@winterqt:nixos.devWinter (she/her)surprised this machine hasn't oom'd yet18:46:05
@winterqt:nixos.devWinter (she/her)very surprised18:46:37
@winterqt:nixos.devWinter (she/her)guess colmena buildOnTarget is more efficient than nixos-rebuild 😓18:46:58
7 Mar 2022
@winterqt:nixos.devWinter (she/her)

so i use colmena exec to reboot all the machines in my hive, and it always exits with an error because it's not able to call nix(?); says it exits with an error code of 255

why would it be trying to run nix? and is it trying to do it on the remote machine which is probably down by the time it tries to run it...?

03:17:21
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @winterqt:nixos.dev

so i use colmena exec to reboot all the machines in my hive, and it always exits with an error because it's not able to call nix(?); says it exits with an error code of 255

why would it be trying to run nix? and is it trying to do it on the remote machine which is probably down by the time it tries to run it...?

Oh right, I should change the error message from "Nix exited with error code" to "Child process exited with error code." It's misleading in this case.
04:04:25
@winterqt:nixos.devWinter (she/her)
In reply to @zhaofeng:zhaofeng.li
Oh right, I should change the error message from "Nix exited with error code" to "Child process exited with error code." It's misleading in this case.
would the child process be ssh in this case?
04:33:35
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @winterqt:nixos.dev
would the child process be ssh in this case?
Yeah, I presume it was because of the remote host disconnecting. I should really add a --reboot feature so there is no need to do a colmena exec after activation
04:35:48
@github:maunium.net@github:maunium.net [zhaofengli/colmena] tv42 opened issue #62: nix-eval-jobs patch causes build failure with nixos-21.11 nixpkgs

If you use a flake of colmena and do inputs.nixpkgs.follows = "nixpkgs";, it fails to build:

error: builder for '/nix/store/2sikwzzkkzggxi7snbml0sc7sv4wkzn2-nix-eval-jobs-0.0.1-colmena.drv' failed with exit code 1;
       last 10 log lines:
       > unpacking source archive /nix/store/wndp1lpb7g9gs3fmh4pjmqw80pjiw606-source
       > source root is source
       > patching sources
       > applying patch /nix/store/mgnkwc0sbk8x3jn4x7gny013mp4gsvfh-1e0f309fefc9b2d597f8475a74c82ce29c189152.patch
       > patching file src/nix-eval-jobs.cc
       > Hunk #2 FAILED at 37.
       > Hunk #3 succeeded at 96 with fuzz 1 (offset -7 lines).
       > Hunk #4 succeeded at 235 (offset -14 lines).
       > Hunk #5 succeeded at 288 (offset -14 lines).
       > 1 out of 5 hunks FAILED -- saving rejects to file src/nix-eval-jobs.cc.rej
       For full logs, run 'nix log /nix/store/2sikwzzkkzggxi7snbml0sc7sv4wkzn2-nix-eval-jobs-0.0.1-colmena.drv'.

In general, I like to run my systems on stable nixpkgs as much as possible.

19:25:32
8 Mar 2022
@github:maunium.net@github:maunium.net [zhaofengli/colmena] Repo forked into glenn-m/colmena 04:04:03
@github:maunium.net@github:maunium.net [zhaofengli/colmena] glenn-m opened pull request #63: apply_local: Fix nixos detection from os-release

This fixes apply-local not detecting the system as NixOS due to the changes in the format of the os-release file.

Details on the changes made to the os-release file can be found in the following commit https://github.com/NixOS/nixpkgs/commit/bae181d3f0f453d9a23cf5e899c2cb0f96e91fef.

I'm new to Rust so let me know if I've missed anything, thanks!

04:23:28
@github:maunium.net@github:maunium.net [zhaofengli/colmena] zhaofengli merged pull request #63: apply_local: Fix nixos detection from os-release 04:52:24
@winterqt:nixos.devWinter (she/her) unstable manual is 404ing 😕
was it moved to 0.3 (instead of unstable)?
13:07:28
@finn:tomesh.netfinn joined the room.16:16:17
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @winterqt:nixos.dev
unstable manual is 404ing 😕
was it moved to 0.3 (instead of unstable)?
Oops, my bad. I added linkcheck as an additional mdbook output, and that changed the directory structure. I just pushed the fix and it should be live soon. Thanks for the heads up!
18:29:15
@github:maunium.net@github:maunium.net [zhaofengli/colmena] zhaofengli published v0.2.2: v0.2.2 - Fix `apply-local` on nixos-unstable 19:09:12
11 Mar 2022
@github:maunium.net@github:maunium.net [zhaofengli/colmena] scvalex opened issue #64: Add plan/diff command

A plan or diff-current-to-next command would be useful to have.

We can get something pretty close already by combining colmena and nix-diff:

$ colmena build --on laptop
[INFO ] Using configuration: ./deployment.nix
[INFO ] Enumerating nodes...
[INFO ] Selected 1 out of 5 hosts.
       ✅ 11s All done!
laptop ✅ 10s Evaluated laptop
laptop ✅ 1s Built "/nix/store/r829pyjngqxmn7k1j9j39w3rcaarg2d1-nixos-system-laptop-21.11pre-git"

$ nix-diff --color always --character-oriented /var/run/current-system /nix/store/r829pyjngqxmn7k1j9j39w3rcaarg2d1-nixos-system-laptop-21.11pre-git | less -R

There are a few problems with the above:

  • nix-diff is a separate package to install,
  • the diff isn't great (the full diff contains the entirety of options.xml and is 26MB in size); that said, i think that if we diffed just a few specific things like system-path, that would be useful,
  • the diff requires the previous system derivation to be available locally.

If you're interested in a feature like this, I'd be up for rewriting nix-diff as a rust library and trying to integrate it into colmena.

11:28:18
@finn:tomesh.netfinn left the room.20:08:50
13 Mar 2022
@winterqt:nixos.devWinter (she/her) Does Colmena eval all nodes even when doing --on ...? 03:02:17
@winterqt:nixos.devWinter (she/her)I ask since it's throwing an error in a configuration for a host that I didn't specify -- it doesn't try to deploy to it, though.03:03:18

Show newer messages


Back to Room ListRoom Version: 6