!VRULIdgoKmKPzJZzjj:nixos.org

Nix Hackers

973 Members
For people hacking on the Nix package manager itself206 Servers

Load older messages


SenderMessageTime
19 May 2026
@yetanothermask:matrix.orgTailsYay! lol13:09:54
@todoqki:matrix.orgtodo joined the room.15:40:59
@amadaluzia:4d2.orgamadaluzia changed their profile picture.20:56:36
20 May 2026
@reyg0blin:matrix.orgTickle set a profile picture.10:03:21
@joerg:thalheim.ioMic92Any negative downside if we namespace binfmt inside nix builds? https://github.com/lxc/lxc/issues/4520 could be very useful to work around partially broken cross builds.14:37:35
@k900:0upti.meK900 This will break people intentionally using qemu-user or similar system wide 14:39:23
@dramforever:matrix.orgdramforevertbh i don't like "work around partially broken cross builds"14:42:09
@joerg:thalheim.ioMic92Okay but than you can actually make this implicit behaviour explicit 14:42:21
@dramforever:matrix.orgdramforever buuuuuut i made this for the other way around, un-working-around broken cross builds if you have global binfmt_misc https://github.com/NixOS/nix/pull/15539 14:43:27
@joerg:thalheim.ioMic92
In reply to @dramforever:matrix.org
tbh i don't like "work around partially broken cross builds"
Live is too short to have to patch all kinds of broken perl packages
14:43:34
@dramforever:matrix.orgdramforever the annoying thing is you have to be root to write to binfmt_misc, because the thing is hard coded to be owned by 0:0 in its userns 14:44:59
@dramforever:matrix.orgdramforeverbut also, if you want to, you can just mount your own binfmt_misc14:47:47
@dramforever:matrix.orgdramforeverwithout nix even knowing it14:47:55
@joerg:thalheim.ioMic92
In reply to @dramforever:matrix.org
the annoying thing is you have to be root to write to binfmt_misc, because the thing is hard coded to be owned by 0:0 in its userns
I think we already have this for container enabled builds... But it is a bit annoying if we would have to rely on it
14:48:03
@dramforever:matrix.orgdramforeveras in, if you want to modify derivations14:48:11
@dramforever:matrix.orgdramforeveryou can just do the cursed dance to get yourself into a user namespace with a binfmt_misc you manage14:48:54
@dramforever:matrix.orgdramforever... actually let me check something brb14:51:46
@joerg:thalheim.ioMic92 @dramforever:matrix.org: I put it on my review list but let me know if I don't get back in a week 14:55:47
@joerg:thalheim.ioMic92It looks mostly fine I did just want to read the double userns stuff again on a bigger screen14:56:46
@dramforever:matrix.orgdramforever Mic92: so i don't know how to do it with https://man7.org/linux/man-pages/man1/unshare.1.html, might try later, but what i did in #15539 shows that you can definitely give yourself binfmt_misc without privileges 15:06:04
@dramforever:matrix.orgdramforever * Mic92: so i don't know how to do it with https://man7.org/linux/man-pages/man1/unshare.1.html, might try later, but what i did in #15539 shows that you can definitely give yourself a binfmt_misc without privileges 15:06:11
@dramforever:matrix.orgdramforeveras said in the pr description #15539 works even on rootless nix15:06:29
@dramforever:matrix.orgdramforeverso if you're willing to do surgery on the bad perl stuff, i think you can get away with not touching nix at all15:07:08
@dramforever:matrix.orgdramforever* so if you're willing to do derivation surgery on the bad perl stuff, i think you can get away with not touching nix at all15:07:17
@dramforever:matrix.orgdramforeveri'm thinking about the implications of a more literal "Allow write access to binfmt_misc when using Linux kernel >= 6.7", as in the title of that lxc issue, but currently i'm inclined to think we don't want that15:08:48
@dramforever:matrix.orgdramforever you might also want to know that there's no way to add binfmt_misc interpreters for a userns, only fully replace, so theoretically you can run into problems with an inner binfmt_misc on an binfmt_misc-emulated-cross build but at that point you're stretching everything too hard 15:14:56
@dramforever:matrix.orgdramforever * you might also want to know that there's no way to add binfmt_misc interpreters for a userns, only fully replace, so theoretically you can run into problems with an inner binfmt_misc on an binfmt_misc-emulated-cross build but at that point you're stretching everything too hard (does qemu user even work for this? maybe there are less strech scenarios. idk.) 15:15:21
@dramforever:matrix.orgdramforever okay i read the actual man page and you can do the double userns dance with
unshare --map-root-user --pid --fork --load-interp ":py:E::py::$(which python3):" unshare --map-user "$(id -u)" --map-group "$(id -g)" bash
15:38:02
@dramforever:matrix.orgdramforever * okay i read the actual man page and you can do the double userns dance with something like
unshare --map-root-user --pid --fork --load-interp ":py:E::py::$(which python3):" unshare --map-user "$(id -u)" --map-group "$(id -g)" bash
15:38:13
@dramforever:matrix.orgdramforevermake of that what you will15:41:57

Show newer messages


Back to Room ListRoom Version: 6