kairos icon indicating copy to clipboard operation
kairos copied to clipboard

NixOS Kairos build

Open Itxaka opened this issue 1 year ago • 3 comments

Hey everyone, is there any resource I can receive guidance from regarding building a dockerfile to create a base NixOS system that is compatible with Kairos? I currently have a 15+ node arm64 RPI cluster with 2 amd64 server racks and I would really like to integrate Kairos with Nix as I see this can significantly ease standing up k8s infra.

I currently have this <https://github.com/gitpod-io/template-nixos|gitpod Nix ephemeral template> I use and was wondering how I could perhaps take the <https://github.com/gitpod-io/template-nixos/blob/main/.gitpod.Dockerfile|included dockerfile> and model a new base template for Kairos on NixOS.

<@U04PFB91Q1F> did mention in the thread linked above that the minimum needed would be systemd, dracut (which seems to be a initramfs generator) and kernel.

I am not sure where or how I can proceed to create the base file, although I am familiar with the <https://kairos.io/docs/reference/image_matrix/|image support matrix> and <https://kairos.io/docs/reference/build-from-scratch/|building Kairos from scratch>

Apologies if I am not as technically competent or very clear as I am only a DevOps intern and would like to build up my skillset.

Slack Message

Itxaka avatar Jul 26 '23 19:07 Itxaka

looks like a base nixos image with the required componets could be constructed via

FROM nixos/nix
RUN nix-channel --update
RUN nix-env -i systemd dracut linux

But that its as far as I can go as I have zero idea of nix usage. Next thing would be to enable the systemd services but that would need some configuration in nix style which I have no idea where it goes https://nixos.wiki/wiki/Systemd-networkd

Then it would need to build the initramfs with our immucore module, which I cant find any info on how its supposed to work on where the config is for the initramfs or how to substitute it with a dracut build initrd.

Thats as far as I can go with my current understanding of nix. Not sure if this would be possible as how currently kairos is or its just a lack of knowledge in my part.

Itxaka avatar Jul 27 '23 08:07 Itxaka

Hi are there any plans to release an official release for NixOS flavored variant any time soon? Or even updating the build instructions to support NixOS?

RyzeNGrind avatar Jan 28 '24 08:01 RyzeNGrind

Hi are there any plans to release an official release for NixOS flavored variant any time soon? Or even updating the build instructions to support NixOS?

Not much nix knowledge in the team unfortunately nor many spare cycles to work on this.

If community can provide info on how to build it it would be welcome into the Kairos family but for now it dowsnt look like there are many contributions for this :(

I tried a bit as shown in the comment but my knowledge is very limited in this so no idea how to proceed.

Itxaka avatar Jan 28 '24 11:01 Itxaka