[Nix-dev] Packaging free software that costs money

Nikolay Amiantov ab at fmap.me
Mon Jul 11 02:15:49 CEST 2016


On 07/06/2016 01:50 PM, Bjørn Forsman wrote:
> One improvement we can do is making it easier to run pre-built
> binaries. Right now you have to create a Nix file with
> pkgs.buildFHSUserEnv and pass in a lot of data[1].
> 
> What if we write a script that creates an FHS environment from all
> profiles (system, default, user)? "nix-run-impure myprog"? It would
> (almost) be as easy to run prebuilt programs on NixOS as any other
> distro. The result would be a mix of nix-shell, steam-run and
> buildFHSUserEnv.

This idea seems interesting to me. That said, I cannot immediately see
how can we implement it because the main content of FHS environments are
not binaries but libraries, and those are not typically in profiles.

We can e.g. try to traverse closure of all references and take all
libraries found, but this seems problematic to me because we (rightfully
spoiled by Nix) often use several different versions of one library for
different binaries (better: with different features, worse: different
versions). Exposing those mixed lead to bugs like #15498[1].

So for now I don't see anything better than a curated set of libraries
like steam-run. OTOH steam-run is, by design, hooked to use Steam
Runtime, which is pretty ancient and consists of downloaded binary
blobs. With some overriding you can get a fully "native" steam-run:

(steam.override { nativeOnly = true; }).run

Steam Runtime is a pretty well designed set of libraries -- Valve needed
to make something that would be able to fulfill library needs for games
and applications alike (since they also sell apps in their store). To
clarify: this uses a list of our packages to mimic actual Steam Runtime,
without any binary blobs. It's also pretty incomplete.

What do you all think of adding "fhs-run" alias for the above derivation
and advertising this as the way to try when you need to run something
proprietary, quick and dirty? At least it's a good start. First
improvement would be to allow easy overriding to add extra packages.

1: https://github.com/NixOS/nixpkgs/issues/15498

-- 
Nikolay.


More information about the nix-dev mailing list