NixOS / infra

NixOS configurations for nixos.org and its servers
MIT License
229 stars 94 forks source link

delft: allow deployment through colemena #400

Closed mweinelt closed 6 months ago

mweinelt commented 6 months ago

Provide an output that translates nixosConfigurations to a colmena- compatible output.

Colmena provides a convenient wrapper around building and deploying machines, than the bare nixos-rebuild we had been using up until now.

mweinelt commented 6 months ago

❯ colmena build
[INFO ] Using flake: git+file:///home/hexa/git/nixos/infra?dir=delft
[INFO ] Enumerating nodes...
[INFO ] Selected all 3 nodes.
       ✅ 3m All done!
 (...) ✅ 24s Evaluated pluto, rhea, and haumea
haumea ✅ 1s Built "/nix/store/6ad5kxcgj7h762kl837jkv0nq3k7yl41-nixos-system-haumea-23.11.20240228.747e63c"
 pluto ✅ 1s Built "/nix/store/c6nrj676rybwbxwccmb3a3szc3csl2qx-nixos-system-pluto-23.11.20240228.747e63c"
  rhea ✅ 2m Built "/nix/store/vh47l0l2fy0wfppw1lhwsk6rwj02qrq7-nixos-system-rhea-23.11.20240228.747e63c"   
RaitoBezarius commented 6 months ago

So you may want to grab a fresh copy of https://github.com/zhaofengli/colmena/pull/198 it's really good.

mweinelt commented 6 months ago

I think incremental improvements are fine. This looks decent, and I would like to defer to @zhaofengli regarding its integration in colmena.

lf- commented 6 months ago

I think incremental improvements are fine. This looks decent, and I would like to defer to @zhaofengli regarding its integration in colmena.

imo just copy the wrapper to your own repo because it's not obvious how this stuff can be made applicable to all repos with stuff like main vs master and so on, and the way the script works is relatively self-descriptive. It's in a contrib directory and licensed CC0 for that reason: it works perfectly but any properly generalized solution will be much harder to implement and one might want customization anyway, so it seems reasonable to just do an easy fix now and if a nicer feature happens, adopt that.

bonus win with the script: you can easily modify it to nixos-rebuild as well, if you want.

zimbatm commented 6 months ago

too bad colmena doesn't work for the macOS boxes, but it at least makes the NixOS boxes easier to deploy.

delroth commented 6 months ago

In theory doesn't colmena only require SSH and a switch-to-configuration script? It might not be impossible to make it work with nix-darwin.

RaitoBezarius commented 6 months ago

In theory doesn't colmena only require SSH and a switch-to-configuration script? It might not be impossible to make it work with nix-darwin. On Mon, 11 Mar 2024, 17:33 Jonas Chevalier, @.> wrote: too bad colmena doesn't work for the macOS boxes, but it at least makes the NixOS boxes easier to deploy. — Reply to this email directly, view it on GitHub <#400 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABRQLTMMB46E7J6NAUJXN3YXVT7FAVCNFSM6AAAAABELLRMQSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBXHA3TCMRVGE . You are receiving this because your review was requested.Message ID: @.>

Yes, I am planning to introduce generic hooks for "bring your own switch-to-configuration logic" for Liminix and others systems, we discussed it in https://matrix.to/#/!UKDpaKNNsBpOPfLWfX:zhaofeng.li/$DFKVuVYaMjCn1drriPf2xA9w9Qwl4yMB07dxnbQKgHM?via=nixos.org&via=matrix.org&via=nixos.dev FWIW.