Can I create a VLAN on boot.initrd?

Hello NixOS newbie here.

So what I’m triying to accomplish is to create a VLAN on the stage 1 of boot so I can connect to my server via ssh and unlock the luks encrypted root. So I wonder if that is possible?

I already have configured the part of unlocking via ssh but I can’t reach the server because I need to put it on a VLAN, if I introduce the luks key physically I can log and reach the internet just fine and also can log via ssh because I configured a VLAN with networking.vlans but I don’t find a way to configure a VLAN on the initrd.

Anyway thanks in advance to this amazing community, I’m loving NixOS so far :grinning:



PD: the link is to pastebin

Related: initramfs-tools-network-hook/ at master · stcz/initramfs-tools-network-hook · GitHub

It seems that it would be needed to add some scripts to the initramfs. Is anyone remotely familiar with how to do this?

Maybe It can be implemented like the ip= definition on boot.kernelParams?

alse how I modify that file on a vm generated from my config to test the changes? I might try to implemented myself and open a pull request when finished.

1 Like