Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NixOS Kairos build #1652

Open
Itxaka opened this issue Jul 26, 2023 — with Slack · 3 comments
Open

NixOS Kairos build #1652

Itxaka opened this issue Jul 26, 2023 — with Slack · 3 comments

Comments

Copy link
Member

Itxaka commented Jul 26, 2023

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
Copy link
Member Author

Itxaka commented Jul 27, 2023

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.

@RyzeNGrind
Copy link

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?

@Itxaka
Copy link
Member Author

Itxaka commented Jan 28, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants