!tCyGickeVqkHsYjWnh:nixos.org

NixOS Networking

906 Members
Declaratively manage your switching, routing, wireless, tunneling and more.265 Servers

Load older messages


SenderMessageTime
29 Jul 2025
@elvishjerricco:matrix.orgElvishJerricco
In reply to @marcel:envs.net
Is there no systemd equivaltent to copy_bin_and_libs? When i use systemd.storePaths, the libs are missing. Because this is a python script it is quite annoying to specify every store path needed seperatly.
I don't think we've ever tried to do Python in systemd initrd... that's indeed a new challenge. Likely the only reason it works in scripted is because it copies the whole Python program's closure, which would mean your initrd is drastically larger than necessary
07:00:32
@elvishjerricco:matrix.orgElvishJerricco yea, indeed, copy_bin_and_libs ${getExe ifstate} on your branch results in a non-functional nuke-refs'd program, and using the program outside of extra-utils instead pulls in the whole closure for a whopping 75M of initrd size. 07:22:17
@elvishjerricco:matrix.orgElvishJerricco * yea, indeed, copy_bin_and_libs ${getExe ifstate} on your branch results in a non-functional nuke-refs'd program, and using the program outside of extra-utils instead pulls in the whole closure for a whopping 75M increase of compressed initrd size. 07:22:41
@elvishjerricco:matrix.orgElvishJerriccoso getting python to behave well for initrd is going to be... tricky07:23:09
@elvishjerricco:matrix.orgElvishJerriccoluckily systemd initrd gives you more control over this sort of thing, but I'm not sure what the right approach is going to be07:24:25
@marcel:envs.netMarcelI mean Thomas is planing on rebuilding ifstate in rust because it's currently kind of slow of you use it on conjunction with keepalived. But this will probably take two years or so07:29:25
@k900:0upti.meK900I feel like it might be easier to switch to networkd07:29:46
@k900:0upti.meK900Than it is to coerce ifstate into running in initrd07:29:53
@elvishjerricco:matrix.orgElvishJerriccoI'm assuming python is too dynamic-brained to be able to statically determine which python files are needed by a given program?07:36:28
@elvishjerricco:matrix.orgElvishJerriccowell, I guess that's only a fraction of the problem, since you still need to include native libs and the interpreter and all that. Yea this sounds like pain07:37:40
@k900:0upti.meK900Yeah07:37:57
@marcel:envs.netMarcel
In reply to @elvishjerricco:matrix.org
yea, indeed, copy_bin_and_libs ${getExe ifstate} on your branch results in a non-functional nuke-refs'd program, and using the program outside of extra-utils instead pulls in the whole closure for a whopping 75M of initrd size.
Is there a reason why copy_bin_and_libs should not be working with systemd stage one?
07:39:52
@elvishjerricco:matrix.orgElvishJerricco copy_bin_and_libs is a extra-utils thing, which is not how systemd initrd defines its binaries. 07:40:42
@elvishjerricco:matrix.orgElvishJerriccoSee: https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/kernel/make-initrd-ng/README.md07:40:44
@elvishjerricco:matrix.orgElvishJerriccoheh, that readme needs an update.07:43:08
@elvishjerricco:matrix.orgElvishJerriccoit describes taking pairs of paths as input but nowadays it's json07:43:19
@elvishjerricco:matrix.orgElvishJerricco it also doesn't cover a couple of the dependencies it chases, namely wrapped executables and the .dlopen ELF section things that systemd uses now. 07:44:13
@elvishjerricco:matrix.orgElvishJerriccooh no it does mention the wrapped exes07:45:05
@elvishjerricco:matrix.orgElvishJerricco oh, if you were asking why I said copy_bin_and_libs "results in a non-functional nuke-refs'd program", I meant when trying to add the program to scripted initrd. 07:51:06
@marcel:envs.netMarcelBut I've been using ifstate in scripted initrd for over a year without any problem.14:03:05
31 Jul 2025
@sammy:cherrykitten.dev@sammy:cherrykitten.dev left the room.10:03:53
29 Jul 2025
@emilazy:matrix.orgemilyfeel like we should have a "just add the normal closure" thing for systemd stage 114:03:51
@emilazy:matrix.orgemily(or just do that unconditionally and trim down some closures/split outputs :P)14:04:04
@marcel:envs.netMarcel Idk do you see any alternatives that should currently be doable? Specifying every store path that's necessary? Building a static binary of ifstate? Idk if that's possible using python 14:19:24
@k900:0upti.meK900You can't build a static binary with Python14:19:48
@k900:0upti.meK900You can probably drag all of Python into initrd14:19:54
@k900:0upti.meK900If you're OK with having a 100MB+ initrd14:19:59
@marcel:envs.netMarcel
In reply to @k900:0upti.me
If you're OK with having a 100MB+ initrd
I mean it wasn't a problem until now
14:20:18
@hexa:lossy.networkhexayeah, python is all about propagating dependencies into a pythonpath14:20:20
@marcel:envs.netMarcel
In reply to @k900:0upti.me
You can't build a static binary with Python
Yeah I know but for windows these things exist which encapsulate you whole python stuff into one exe
14:20:50

Show newer messages


Back to Room ListRoom Version: 6