!UKDpaKNNsBpOPfLWfX:zhaofeng.li

Colmena

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

Load older messages


SenderMessageTime
7 May 2022
@zhaofeng:zhaofeng.liZhaofeng Li Wanja Hentze: Somehow I didn't get notified of this message. If you are interested in doing that, please send a PR! 01:17:22
@dantefromhell:matrix.orgdantefromhellyeah I feel there's this recursive dependency on nix all over the nix ecosystem 🤯🤮01:25:48
@schnecfk:ruhr-uni-bochum.deCRTified
In reply to @dantefromhell:matrix.org
Hi,
I just stumbled over colmena when research tools to deploy Nix from flakes onto a variety of machines (laptop, VMs, servers, Raspberry).

One thing I couldnt figure out though if it's possible to automate the initial nix install (incl partitioning) with colmena?
For systems which you provision externally ("dd a ready-to-go-image on an sd-card", you could also define your config while importing sd-image-aarch64.nix from nixpkgs. Then, you could build the config.system.build.sdImage-attribute and use the resulting image on your device 🙂
02:03:26
@schnecfk:ruhr-uni-bochum.deCRTifiedat least for the sd-card, this would also include partitioning02:04:00
@blaggacao:matrix.orgDavid Arnold (blaggacao) Zhaofeng Li: I recently had a chat with Rom Garbas who mentioned that nix might have a builtin nix apply in stock that would make the part of colmena's current eval.nix and similar techniques, but I'd assume with better eval cache properties. Currently that facility is not really exposed, but it's what used for nix bundle. We should sharpen our intelligence on this and prepare for it. 02:28:00
@blaggacao:matrix.orgDavid Arnold (blaggacao) Maybe we can even ask for exposure of said nix apply 02:28:24
@blaggacao:matrix.orgDavid Arnold (blaggacao)* Zhaofeng Li: I recently had a chat with Rok Garbas who mentioned that nix might have a builtin `nix apply` in stock that would make the part of colmena's current `eval.nix` and similar techniques, but I'd assume with better eval cache properties. Currently that facility is not really exposed, but it's what used for `nix bundle`. We should sharpen our intelligence on this and prepare for it.02:28:43
@zhaofeng:zhaofeng.liZhaofeng Li Any links to docs on this nix apply? 02:29:50
@blaggacao:matrix.orgDavid Arnold (blaggacao)Afaic, it's not exposed anywhere yet. I can ask for more details next week.02:32:48
@blaggacao:matrix.orgDavid Arnold (blaggacao)I assume the main benefit is that the cache integrity of the flake is not destroyed.02:33:09
@blaggacao:matrix.orgDavid Arnold (blaggacao)Ot came up during a discussion about nix-eval-cavhe.02:33:22
@blaggacao:matrix.orgDavid Arnold (blaggacao)* Ot came up during a discussion about nix-eval-cache.02:33:31
@blaggacao:matrix.orgDavid Arnold (blaggacao)Maybe this? https://github.com/NixOS/nix/blob/master/src/nix/bundle.cc#L7802:37:29
@blaggacao:matrix.orgDavid Arnold (blaggacao)Anyway, the design pattern is pretty similar / the same.02:38:03
@zhaofeng:zhaofeng.liZhaofeng LiTaking a look in a bit, thanks 👍02:44:01
@blaggacao:matrix.orgDavid Arnold (blaggacao)Looks like that is the function, the counterpart is pretty simple: https://github.com/NixOS/bundlers/blob/master/flake.nix02:48:42
@blaggacao:matrix.orgDavid Arnold (blaggacao) So in essence, one flake.is "wrapped around" the other. 02:49:00
@blaggacao:matrix.orgDavid Arnold (blaggacao)* So in essence, one flake is "wrapped around" the other.02:49:10
@blaggacao:matrix.orgDavid Arnold (blaggacao)You could also think of it in terms of 'passing arguments to flakes'.02:49:37
@blaggacao:matrix.orgDavid Arnold (blaggacao)Or 'flake inheritence'02:49:51
@dantefromhell:matrix.orgdantefromhell CRTified: The downside is this woukd only work with raspberrys plus I dont use the SD-Cards (long term reliability) since USB boot is now possible. 10:41:56
@dantefromhell:matrix.orgdantefromhellFrom research it feels possible to get NixOS LIVE booted on all devices (kexec, pxe, usb sticks) so my hope is to build something nix-based from there for installation & management.10:46:14
@schnecfk:ruhr-uni-bochum.deCRTified
In reply to @dantefromhell:matrix.org
CRTified: The downside is this woukd only work with raspberrys plus I dont use the SD-Cards (long term reliability) since USB boot is now possible.
You are free to create arbitrary layouts, so you can dd it on other media, too. I'm using RockPis and boot them from NVMe :) But I get your point, the same thing for x86 might be a bit more effort I think
10:47:07
@dantefromhell:matrix.orgdantefromhellThe first issue I recognized with colmena is the hostname match check for local deploys. That breaks fresh installs and machine renames, no?10:47:21
@dantefromhell:matrix.orgdantefromhell CRTified: the dd approach is also suboptimal with differing disc size. it needs some post-processing... 10:48:47
@schnecfk:ruhr-uni-bochum.deCRTifiedThe aarch64 installer image autoresizes on boot10:49:21
@dantefromhell:matrix.orgdantefromhell CRTified: and stuff like ZFS raidZ might be impossible (would need to test) 10:50:17
@schnecfk:ruhr-uni-bochum.deCRTifiedhttps://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/sd-card/sd-image.nix#L242-L267 here's what's done to expand on boot10:51:01
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @dantefromhell:matrix.org
The first issue I recognized with colmena is the hostname match check for local deploys.
That breaks fresh installs and machine renames, no?
When renaming machines, you can override which node apply-local selects with --node. For fresh installs, you need to run the activation script when chrooted into the new root (ex: the external script I linked) and the normal logic doesn't work.
18:21:34
8 May 2022
@dantefromhell:matrix.orgdantefromhell* yeah I feel there's this recursive dependency on nix all over the nix ecosystem 11:20:53

Show newer messages


Back to Room ListRoom Version: 6