NixOS and Portable Executables
23 comments
·February 11, 2025romesmoke
Were I to design a computer (both HW & SW), the founding principle should be compatibility with legacy code at no expense of performance or user effort.
Stuff like this gives me hope that I'm not merely wet-dreaming.
marliechiller
did you mean to say "wet"-dreaming in this context? Seems an odd addition to simply "dreaming"
bmacho
https://en.wiktionary.org/wiki/wet_dream
An exciting fantasy; a very appealing, ideal thing, person, or state of affairs.
marliechiller
"An erotic dream bringing the sleeper to orgasm" - this was what I was confused about.
romesmoke
Nah, the alternative that popped in my mind was "phantasizing", so I guess my wording aligns with my feelings. Whether these feelings are healthy is another discussion :D
yjftsjthsd-h
> But APEs have been a little finicky for me. I run NixOS as my primary operating system, and sometimes an APE will refuse to launch, or I’ll need to pass --assimilate to it and permanently turn it into an x86-64 Linux binary before it’ll work.
I wonder if anyone could expand on "sometimes"? Because I've got a llamafile on nixos that seems to work fine. I'd assumed that meant that APE+NixOS worked, but it sounds like it only works part of the time?
sandreas
The main reason I ditched NixOS was the missing ability to run dynamically linked executables by default and not wanting to deal with the possible fixes.
Good to See that there is hope for that.
max-privatevoid
You ditched NixOS for the very reason it was created. Not being able to run binaries with missing libraries is a feature. The idea is to make you aware of your implicit dependencies, and to force you to make them explicit.
This makes me wonder if you were subjected to false advertising.
mingus88
Advertising in the Nix space is wild. I first learned about it in the realm of reproducible builds as well, which feels more like a “nix the language” feature
This led me to install nixos which is really kind of an output of that design, a distribution built from nixpgks. There are some rough spots that make it hard for a daily driver.
That distro is a bit much for my needs and I have retreated back to a home-manager cross platform setup for my arch/debian/macos systems, and it turns out the entire reason I started looking at Nix (builds) went nowhere
Getting adoption for Nix builds at work or with my OSS projects is has been hard. Docker is everywhere and easy, while Nix feels like a fractured and poorly documented ecosystem.
sandreas
Maybe. I was drawn in by the reproducable setup routine that can't break the existing system.
I didn't think too mich about how it is achieved.
Diti
I know it’s not a default, but `buildFHSUserEnv` is probably what you would have been interested in.
kokada
There is also `nix-alien` (I am the author BTW), that automates the process of listing all program dynamic libraries (as long they're not loaded at runtime) and creating the `shell.nix` file with `buildFHSUserEnv`.
And also `programs.nix-ld` now, that allow you to impurely include libraries available to all programs. It does some LD_LIBRARY_PATH hacks, but AFAIK it worked well enough for me when I had this in my system (I don't anymore since I barely run dynamically linked executable from other sources).
sandreas
Thanks. Try `tone`[1] my pet project. I'm pretty sure it won't work without tinkering out of the box. Since I need a dev machine, that supports my FOSS projects, NixOS is not for me :-) BTW it was not the ONLY reason, I ditched it, but the main reason. There were a lot of nice advantages to NixOS, but they did not outweight the issues I personally had.
jowea
steam-run solves this for me at least.
_jackdk_
Seconded. Despite sounding like it's only a tool for games, `steam-run` is very useful for generally running foreign binaries on NixOS. There's also `nix-ld`: https://github.com/nix-community/nix-ld
null
null
revskill
The font size and color and layout seems uneasy for me.
_jackdk_
I'm trying to match the EGA colour palette for most if not all of my colour selections, and #555-on-#fff passes WCAG AAA requirements for body text. If I make it #000-on-#fff, I struggle to find good ways to differentiate inline `code` sections.
As for text size, the CSS expresses no opinion: I'm expecting your user agent to act in your best interest.
Do you have any suggestions?
The post title has been mangled, perhaps by the title simplifier. The "actually" in the title is important - the post is about Justine Tunney's work on "actually portable executables" (https://justine.lol/ape.html). Without it, it sounds like it refers to standard Microsoft "Portable Executable" (PE) format binaries.