# How to make NixOS so easy that people can be productive up front, without having to first learn the nix language?

**URL:** https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625
**Category:** Development
**Created:** [January 24, 2020, 5:19am UTC](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625 "2020-01-24T05:19:32Z")
**Posts on this page:** 17
**Page:** 3

<div class="post-metadata">

### Author: ![SRGOM](https://discourse.nixos.org/user_avatar/discourse.nixos.org/srgom/32/1688_2.png) [@SRGOM](https://discourse.nixos.org/u/SRGOM)
#### Post date: [February 16, 2020, 1:12pm UTC](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625/41 "2020-02-16T13:12:06Z")

</div>

I apologize, that was not my intention. I was trying to make a self deprecating joke.

---

<div class="post-metadata">

### Author: ![trusktr](https://discourse.nixos.org/user_avatar/discourse.nixos.org/trusktr/32/1994_2.png) [@trusktr](https://discourse.nixos.org/u/trusktr)
#### Post date: [March 1, 2020, 6:53am UTC](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625/42 "2020-03-01T06:53:41Z")

</div>

I may have understood. In any case, I like what NixOS is trying to achieve, but there’s lots of hurdles and deep knowledge of both Linux and nixpkgs needed to start _trying_ to be productive. I never had to deal with EFL patching before, which is handy to know.

The whole problem with Linux and C++ in general is it doesn’t have a nice package management system. Everything is ad-hoc, and the existence of “distros” is practically due to the need for package management solutions, and teams to manage the packaging of all applications.

It is the reverse of a modern package management ecosystem like NPM, where the application developer is responsible for packaging and shipping a package, then anyone else can consume it without replicating all of that work.

There’s a package manager called [ied](https://github.com/alexanderGugel/ied) that takes NixOS inspiration (hashing dependencies), but the rest of ied’s behavior is just standard NPM, and it allows any package to depend on any version of any other package.

Now here with Nix we have a package manager that is trying to allow any package to depend on any version of any other package, but the issue is that the underlying system (FHS, etc) that each package is conventionalized on is completely in the way, and required Nix users to create sub-shells with fake FHS environments or patched ELF binaries. It’s basically hacking the very old system to bend it to newer ideas.

Instead, maybe the whole reliance on FHS packages should just be dropped, and instead something decoupled from FHS and ELF (and etc) would be a better path.

There’s package manager called [`Conan`](https://conan.io) for C++ projects that sort of resembles NPM, but for C++. Maybe that, and NPM, can be looked at, and something better created, and then a new operating system built on top of it.

I’m not sure how Conan works exactly, but I know that each of my projects using Conan can have any dependencies they want regardless of version, and they just work, without me having to patch my shell, or without me having to be aware of how to patch ELF (I don’t know if Conan does that or not).

But the key thing about Conan is, it does not interfere with my overall operating system. It leaves my OS in tact, and I don’t need to continually tweak my working environment (like I do in NixOS) to run programs that depend on differing dependencies. That’s a huge benefit.

I see a better future in making an operating system that allows packages to be built independently, rather than all packages relying on globally installed packages.

I don’t know exactly what the solution is, but I believe it should be OS agnostic without depending on specific OS features, and any dependence on the filesystem only needs to happen at the location where a project is being built.

---

<div class="post-metadata">

### Author: ![aanderse](https://discourse.nixos.org/user_avatar/discourse.nixos.org/aanderse/32/1420_2.png) [@aanderse](https://discourse.nixos.org/u/aanderse)
#### Post date: [March 1, 2020, 12:23pm UTC](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625/43 "2020-03-01T12:23:37Z")

</div>

> [@trusktr](#):
>
> I see a better future in making an operating system that allows packages to be built independently, rather than all packages relying on globally installed packages.

This statement sounds like a security nightmare to me. To be fair it is a trade-off: the app developer gets all the power so they can do things correctly (which OS package maintainers do not always do), according to their vision of what correctly means… and the app users end up with lazy app developers who don’t patch against the latest major exploit in included in their stack.

---

<div class="post-metadata">

### Author: ![SRGOM](https://discourse.nixos.org/user_avatar/discourse.nixos.org/srgom/32/1688_2.png) [@SRGOM](https://discourse.nixos.org/u/SRGOM)
#### Post date: [March 1, 2020, 1:05pm UTC](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625/44 "2020-03-01T13:05:24Z")

</div>

What you’re saying is something I somewhat tried to encode in my terse representation… Basically you have to be a dev and a Linux admin to use nixos full time and actually enjoy what it has to offer. (I mean my grandma can use it but then the nixos part would be useless). I’d give this warning to anybody to save their time. (Nixpkgs alone requires only programming experience…)

---

<div class="post-metadata">

### Author: ![KoviRobi](https://discourse.nixos.org/user_avatar/discourse.nixos.org/kovirobi/32/33578_2.png) [@KoviRobi](https://discourse.nixos.org/u/KoviRobi)
#### Post date: [March 1, 2020, 5:41pm UTC](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625/45 "2020-03-01T17:41:26Z")

</div>

> [@trusktr](#):
>
> I’m not sure how Conan works exactly, but I know that each of my projects using Conan can have any dependencies they want regardless of version, and they just work, without me having to patch my shell, or without me having to be aware of how to patch ELF (I don’t know if Conan does that or not).

> [@trusktr](#):
>
> Instead, maybe the whole reliance on FHS packages should just be dropped, and instead something decoupled from FHS and ELF (and etc) would be a better path.

I’d like to point out, indeed that both ELF patching and FHS chroot/virtualisation while is indeed an ad-hoc hack as you pointed out, only necessary for packages that for one reason or other cannot be packaged properly in Nix – and usually this would mean they cannot be packaged properly in Connan (I would imagine) either.

E.g. Adobe reader is shipped as a linked binary, so we cannot link our own libraries hence the need to patch.

Patching steam, and all its applications would be too much work (if at all possible, because we don’t have access to the purchased content to package it), so we virtualise the FHS it expects.

So the way I see it, you would need the same hacks in other approaches too.

The benefit of a cross-language package manager like Nix is that applications can depend on e.g. C libraries, and this way you can capture that dependency too!

---

<div class="post-metadata">

### Author: ![jonringer](https://discourse.nixos.org/user_avatar/discourse.nixos.org/jonringer/32/1348_2.png) [@jonringer](https://discourse.nixos.org/u/jonringer)
#### Post date: [March 1, 2020, 6:06pm UTC](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625/46 "2020-03-01T18:06:35Z")

</div>

> [@trusktr](#):
>
> There’s a package manager called [ied](https://github.com/alexanderGugel/ied) that takes NixOS inspiration (hashing dependencies), but the rest of ied’s behavior is just standard NPM, and it allows any package to depend on any version of any other package.

This is leveraging capabilities of a specific language framework, not really fair against a tool which is generic over all use cases.

> [@trusktr](#):
>
> Now here with Nix we have a package manager that is trying to allow any package to depend on any version of any other package, but the issue is that the underlying system (FHS, etc) that each package is conventionalized on is completely in the way, and required Nix users to create sub-shells with fake FHS environments or patched ELF binaries. It’s basically hacking the very old system to bend it to newer ideas.

I think this is a good example of the fundamental difference between nixos and other operating systems. In typical FHS operating systems, you start from a place of impurity, all of your system installation is dumped into a few directories which get mutated over time. In NixOS, you start from a place of complete purity, and you can “introduce” impurity with buildFHSUserEnv, and a few other tools as **needed**.

It blows my coworkers mind when i can switch between python interpreters with a single command. It’s only really possible because i don’t have to invalidate a system wide installation like you would need to do normally or in windows.

---

<div class="post-metadata">

### Author: ![deliciouslytyped](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/d/858c86/32.png) [@deliciouslytyped](https://discourse.nixos.org/u/deliciouslytyped)
#### Post date: [March 2, 2020, 1:12am UTC](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625/47 "2020-03-02T01:12:13Z")

</div>

I keep wanting to do something like my earlier virtual machines idea for printer/scanner/device drivers. Can they somehow be run in a FHS container? I didn’t look into it much.

---

<div class="post-metadata">

### Author: ![KoviRobi](https://discourse.nixos.org/user_avatar/discourse.nixos.org/kovirobi/32/33578_2.png) [@KoviRobi](https://discourse.nixos.org/u/KoviRobi)
#### Post date: [March 2, 2020, 7:00pm UTC](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625/48 "2020-03-02T19:00:08Z")

</div>

> [@deliciouslytyped](#):
>
> virtual machines idea for printer/scanner/device drivers

I’m not sure I see what you mean, a VM guest has it’s own set of drivers, typically for an abstracted device that the VM host maps to an underlying device – though there is PCI and USB passthrough. Sounds like what you need is help packaging a printer driver, perhaps have a look at [`<nixpkgs/pkgs/misc/cups/drivers>`](https://github.com/NixOS/nixpkgs/tree/master/pkgs/misc/cups/drivers) folder?

Have you opened an issue on GitHub to request help with packaging whichever driver you need?

---

<div class="post-metadata">

### Author: ![cstich](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/c/0ea827/32.png) [@cstich](https://discourse.nixos.org/u/cstich)
#### Post date: [April 29, 2020, 1:04pm UTC](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625/49 "2020-04-29T13:04:11Z")

</div>

> [@Infinisil](#):
>
> autoPatchelfHook

Have you seen [de-generate](https://github.com/lexleogryfon/de-generate) yet? Looks IMHO very similar to what you are proposing.

---

<div class="post-metadata">

### Author: ![cessen](https://discourse.nixos.org/user_avatar/discourse.nixos.org/cessen/32/4857_2.png) [@cessen](https://discourse.nixos.org/u/cessen)
#### Post date: [September 2, 2021, 8:54pm UTC](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625/50 "2021-09-02T20:54:54Z")

</div>

> Maybe a better fit for you is an LSB/FHS distro, and just use `nix` the package manager and set of tools ( `nix-shell` , etc). You will be able to leverage lots of the nice things about Nix whilst being well-supported for a lot software.

I can’t speak for others, but at least in my case the whole reason I switched to NixOS was because of the killer feature of declaratively describing my base system. And I was not disappointed–I absolutely love NixOS for that. I do also enjoy being able to use e.g. nix-shell to fire up different environments quickly, but it’s not the reason I really care about Nix. I care about Nix because of NixOS.

So, personally, what I’m looking for is almost the opposite of what you’re describing. I want Nix to manage the base system, and then “get out of the way” and just let me build and run the software I want. If I switched to another distro as you suggest I would gain the “get out of the way” experience to some extent1, but I would also be losing most of the reason I’m using Nix in the first place: NixOS.

I understand that’s not actually the point of NixOS. And “just use another distro, because that’s not what NixOS is meant to be” is a perfectly reasonable response.

But I think that may be where some of the people on this thread are coming from: they’re looking for an OS that is itself pure, reproducible, and doesn’t degrade over time due to mutability, but that can still interact with and utilize the outside “dirty” world of software relatively transparently without compromising its own purity. NixOS feels tantalizingly close to that with tools like steam-run, and at least in my case that’s extremely enticing.

_1 I’ve actually had a lot of trouble running and/or building certain projects on more traditional distros as well. I do really love Nix for that as well: if something’s a pain to build, at least I only have to solve it once, not over and over every time I’m on a new system._

---

<div class="post-metadata">

### Author: ![carlosdagos](https://discourse.nixos.org/user_avatar/discourse.nixos.org/carlosdagos/32/927_2.png) [@carlosdagos](https://discourse.nixos.org/u/carlosdagos)
#### Post date: [December 10, 2021, 12:49am UTC](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625/51 "2021-12-10T00:49:41Z")

</div>

I get this use case. As mentioned already in this thread [the PR that meant to provide the option](https://github.com/NixOS/nixpkgs/pull/78798) was closed. So it seems that the maintainers have taken a stance on this issue – and to be quite honest, I would be pretty excited about that feature (and likely would use it, for example, at work where building SOEs is a pain and using something like nixos would solve so much IMO).

Maybe someone with the stamina and right attitude could either revitalise that PR, or perhaps turn it into an overlay so that it lives outside of the common nixos codebase, but individuals could opt in? I guess though that would be some kind of happy medium, it would perhaps not meet the original goal of this thread which is: make it _easy up-front_. Turning that into an overlay or explicit opt-in would arguably make things even _more_ confusing.

---

<div class="post-metadata">

### Author: ![tomberek](https://discourse.nixos.org/user_avatar/discourse.nixos.org/tomberek/32/283_2.png) [@tomberek](https://discourse.nixos.org/u/tomberek)
#### Post date: [December 10, 2021, 2:38am UTC](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625/52 "2021-12-10T02:38:54Z")

</div>

Seems to exist here: [GitHub - balsoft/nixos-fhs-compat: LSB&FHS compatibility for NixOS. Intended for containers and VMs.](https://github.com/balsoft/nixos-fhs-compat)

---

<div class="post-metadata">

### Author: ![luochen1990](https://discourse.nixos.org/user_avatar/discourse.nixos.org/luochen1990/32/3092_2.png) [@luochen1990](https://discourse.nixos.org/u/luochen1990)
#### Post date: [January 6, 2022, 6:33am UTC](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625/53 "2022-01-06T06:33:08Z")

</div>

I’m now using docker to run programs from others as a sandbox and as a developping environment for dirty works, and I wrote a script to make things easier.

If you are familier with docker, maybe this share will help:

> <https://gist.github.com/luochen1990/45dd0f40fb3fb8b68b077988def74d28>

The main idea is run docker container with /nix and ~/.config etc mounted into the container.

This is much easier than `buildFHSUserEnv` which need you to figer out dependencies to run a program, and also provide a sandbox (a layered filesystem) so everything dirty will be isolated from your NixOS.

---

<div class="post-metadata">

### Author: ![gabyx](https://discourse.nixos.org/user_avatar/discourse.nixos.org/gabyx/32/11666_2.png) [@gabyx](https://discourse.nixos.org/u/gabyx)
#### Post date: [February 6, 2024, 9:19pm UTC](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625/54 "2024-02-06T21:19:45Z")

</div>

I can only say (with lots of experience in tooling with cmake and Conan). Conan is a package manager, but comes with a lot of quirks which Nix already solves, and better, and more reproducible. There are tons of things you can steer in Conan, package id, overrides in dependency chains, and also ELF patching is needed under the hood although its not really properly done, mostly RPATHs are removed (AFAIR) when packages get stored in the cache, so installing a package and executing an app inside relys on installing/buidling the package to the cache and the creating some `runvirtualenv` thing, which basically boils down to Conan creating a Nix equivalent shell where LD\_LIBRARY\_PATH is filled with all dependencies such that you app inside the package can run.

Conan is a beast and I still think from using Nix packaging a bit now, Nix solves it better, its more isolated. Less troubles, less corrupt build caches with wrong packages which were build on wrong architecture (not to mention the whole libc problem, which needs to be addressed sooner or latter an included into the package id (hash) which it does not at the moment). Nix is the total solution for dependency tracking. Yes it does ELF patching to set RPATHs etc to point to the correct `/nix/store/...` libs. But thats how it is. What would Nix make unbeatable is if it would somehow support Windows, but that is just a shithole into which no Nix maintainer wants to go… (no RPATHs, dependency resolution in dynamic linker at runtime is totally different)

We used Conan mainly for dependencies and when it came down to packaging to put the whole junk into a docker container, we relied on CMake with some Custom tooling (import libraries `conan import` to the predefined Cmake install location and using this to patch the ELF such that it is fully self contained (except libc and stdlib (optional). Basically what Nix already does when you put it in the store (except that its not a self contained package but Nix taking care of these when the derivation gets installed). Nix comes with its own caveats, that you need to go fully in, or leave it. So to package a C++ thing you need to write a `flake.nix` which build the package over a builder (calls CMake or any other tool) which is completely another workflow as people are used to on other Linux setups such as Ubuntu etc… everything is isolated, so you need to build all dependencies also with Nix)

---

<div class="post-metadata">

### Author: ![Cloudef](https://discourse.nixos.org/user_avatar/discourse.nixos.org/cloudef/32/7681_2.png) [@Cloudef](https://discourse.nixos.org/u/Cloudef)
#### Post date: [February 7, 2024, 3:04am UTC](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625/55 "2024-02-07T03:04:41Z")

</div>

> [@trusktr](#):
>
> Imagine, you download a binary anywhere, then you run it, and it just works.

You just opened a can of worms called glibc, dynamic linking and GPU drivers 😅

[![](https://discourse.nixos.org/uploads/default/original/2X/d/d85885f748c92bbd5ab8eecbbc07a657277b9865.jpeg "2021: Year of the Linux Gaming Desktop - Andrew Kelley") ](https://www.youtube.com/watch?v=pq1XqP4-qOo)

Anyhow, closest you can get to this is steam-run or [GitHub - nix-community/nix-ld: Run unpatched dynamic binaries on NixOS [maintainer=@Mic92]](https://github.com/Mic92/nix-ld)

EDIT: noticed that I’m necroposting 🙇‍♂️

---

<div class="post-metadata">

### Author: ![tobiasBora](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/t/9de0a6/32.png) [@tobiasBora](https://discourse.nixos.org/u/tobiasBora)
#### Post date: [February 7, 2024, 8:38am UTC](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625/56 "2024-02-07T08:38:41Z")

</div>

Since the necropost is already done, nix-ld is the best alternative to me as it basically recreates the loaders. And it is now in NixOs, you can enable it with

```auto
    programs.nix-ld.enable = true;

```

And add missing libs via `programs.nix-ld.libraries`. Works great, even with npm etc that typically play poorly with nixos.

---

<div class="post-metadata">

### Author: ![purepani](https://discourse.nixos.org/user_avatar/discourse.nixos.org/purepani/32/10105_2.png) [@purepani](https://discourse.nixos.org/u/purepani)
#### Post date: [May 9, 2024, 4:00pm UTC](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625/57 "2024-05-09T16:00:42Z")

</div>

Just wanted to mention that there is actually work being done for nix on windows!

> [@Nix on Windows?](https://discourse.nixos.org/t/nix-on-windows/1113/109):
>
> We have a beachhead, [Build a minimized Nix with MinGW by Ericson2314 · Pull Request #8901 · NixOS/nix · GitHub](https://github.com/NixOS/nix/pull/8901) is merged! With that, the work can hopefully proceed in parallel. To kick things off, I’ve opened issues: [Rename `SearchPath` · Issue #10539 · NixOS/nix · GitHub](https://github.com/NixOS/nix/issues/10539)[Implement `setStackSize` on Windows · Issue #10540 · NixOS/nix · GitHub](https://github.com/NixOS/nix/issues/10540)[Use portable C++ Pseudorandom number generator · Issue #10541 · NixOS/nix · GitHub](https://github.com/NixOS/nix/issues/10541)[Abstract over `getrusage` · Issue #10542 · NixOS/nix · GitHub](https://github.com/NixOS/nix/issues/10542)[Impleme…](https://github.com/NixOS/nix/issues/10543)

[Previous page](https://discourse.nixos.org/t/how-to-make-nixos-so-easy-that-people-can-be-productive-up-front-without-having-to-first-learn-the-nix-language/5625.md?page=2)
