5 ms·
This excellent Linux distribution has the honour of not needing to recommend a clean install. It deserves to be far more popular. I've run it since 2014 with so
by grumpyprole 5y ago
This excellent Linux distribution has the honour of not needing to recommend a clean install. It deserves to be far more popular. I've run it since 2014 with so few problems, that I can't really claim to "know" Linux anymore.
- kaba0 5y agoThat’s my only problem with it, I will forget what this random file in /etc does or how to configure this and that because it is so simple to do decleratively and never breaks :D
- agumonkey 5y agoMaybe it's like disk usage. You'll always find new stuff to brain on
- xemoka 5y agoI still can’t quite figure out why it’s not more popular... then again, I don’t use it either, sadly, because it’s not as popular as I feel it deserves; I feel like there must be some reason it’s not used more, so in turn haven’t dedicated the time to learn it. Perhaps that’s cyclic...
- Filligree 5y agoSoftware that isn't already packaged is hard to use at all. Often possible -- steam-run is handy; despite the name it basically provides a Ubuntu env -- but many forms of software development are difficult-to-impossible without first learning about Nix internals. It can be a superb experience after you go through that trouble. Or it might not be. It depends on what you're trying to do, exactly, but you have to first spend a lot of effort learning before you'll have your answer. Personally, I found it worth my while.
- gugagore 5y agoCould you briefly mention an example of something that is difficult/impossible without first learning about Nix internals, and allude to what kind of internals need to be learned?
- mason55 5y agoFor starters, the recommended way for really understanding how to setup any package or option is to read the source in nixpkgs. Depends what you mean by "Nix internals" but for me that qualifies.
- rgoulter 5y agoAs one example, IIRC, I can run "npm install -g" on other Linux distributions, but can't with Nixpkgs (since npm will try to install the package to the nix store). Yarn would install it to the home folder.
- 0xCMP 5y agoYea this can be very annoying when a package is not already in nixpkgs or it's out of date. There was a similar issue if you didn't use Python virtualenvs properly, which was an early source of frustration for me personally.
- pxc 5y agoFwiw you can use `npm install -g` if you configure NPM to use your homedir for globally installed packages, as well. It's just not the default behavior.
- kaba0 5y agoAs another example, binary blobs are usually hard to get them to run. But steam-run (a base debian chroot, but you can even specifically build custom ones with only specific libraries available), or in the worst case just running a docker container can solve everything.
- rkangel 5y agoIt is great, but a bit painful to learn and get working for you. I like to use Nix to provide my development environments but that's often painful due to conflicts between the Nix approach and how the language package manager wants to work.
- larusso 5y agoYes this. I tried this a few times but always ended in me banging against some esoteric issue. For example I tried to nixify a project I had which needs ruby and node. If you think you can spin up any version of ruby you are mistaken. The project removes older versions from time to time. The wrapper to fetch the correct gems from nix to setup the nix-env had really hard problems when gems or npm packages started their own native builds. I’m a huge fan of the project and will give it a try again at one point. But I decided for now to go fully manual with arch to get a better understanding of most components involved in Linux before using the automatic that is nix.
- _huayra_ 5y ago> But I decided for now to go fully manual with arch to get a better understanding of most components involved in Linux before using the automatic that is nix. I think one can do this separately, e.g. run NixOS for the host OS and then do LFS or Gentoo or Arch in a VM where you can easily blow things up and revert to a prior snapshot. Also, flakes takes care of the channels shenanigans by pinning input package versions. The hardest thing about Nix is that there is very little in the way of "beginner to intermediate" documentation. There is a huge gap between tutorials about just tweaking configuration.nix and a bit a people who have insanely abstract / modularized configs. The key insight for me was that although they sell the "it's a lazily-evaluated language" thing really hard, at the end of the day there are a few things forcing side effects: - There are certain key attributes that nix will call forceAttrs on (in the interpreter). You can think of these as the "roots" that will act as a starting point for evaluating all other attributes as needed. This is the stuff you usually see like nixosConfigurations, shell, etc. The sad part is that you really have to read the C++ source to understand this it seems. - At the "bottom", there are a bunch of things built in to write to files in the sandboxed result/ directory, but there are also these monstrous bash scripts to do a lot of the heavy lifting, e.g. the mkDerivation one. It's important to read over these scripts to understand what's being written. I've found this youtube series [0] to be a good way to figure out how to go from beginner to intermediate. [0] https://www.youtube.com/playlist?list=PL-saUBvIJzOkjAw_vOac75v-x6EzNzZq- https://www.youtube.com/playlist?list=PL-saUBvIJzOkjAw_vOac7...
- mason55 5y agoIMO the biggest blocker is documentation. The best way to figure out how to do something is typically to search around in the nixpkgs/NixOS options for what you're trying to do, then go read the code. There's very little in the way of "here's a common task that new users want to do and here's the blessed way to do it." Even something that should be Nix's MAJOR selling point, like "create a single repo that configures a bunch of machines, including some NixOS and some other OS" doesn't have a recommended way to do it. Another challenge with the docs is the fact that Nix is * An OS * A package manager * A way to manage dev environments A lot of times I find someone who solves my problem but they solve it in the context of building a dev environment and I want to do it in the context of setting up an OS package. It means that even with all the good tutorials and blog posts out there, you might still have a bunch of work to do to get things to work how you want. This translates into tons & tons of opportunities for users to give up. Also, for some reason, so many examples are done in the imperative manner, and it's not always super clear how to translate them to a declarative setup. Again, just defeating the strengths of Nix and clouding the benefits. If a new user sees a bunch of examples that involve starting nix-shell and installing some dependencies it's both hard to understand the benefits and hard to translate that to a declarative setup.
- gugagore 5y agoIt sounds like nix provides an escape hatch [1] out of the declarative framework into something imperative, e.g. running `apt install $package`. And that seems like it would really ease adoption, since I would assume that it would allow a gradual adoption of the declarative mindset. [1] https://wiki.c2.com/?EscapeHatch https://wiki.c2.com/?EscapeHatch
- mason55 5y agoIMO the escape hatch doesn't get you any real benefits. It's not like you can install packages from apt/yum/aur so you don't get access to any new software (plus nixpkgs is bigger than all those). All it does is result in confusing tutorials that hide the benefits of declarative management and make it difficult for new users who just want to get things working.
- rgoulter 5y agoFor the use case of developer machines, NixOS is much more friction compared to other OSs. It's not about how nice Nix stuff is when it works. It's about how much of a pain it is to get things working when things aren't nice and you don't know what to do. With other popular distributions, you can rely on being able to find a StackOverflow answer with whatever your error message is. Most other OSs and package managers are malleable enough that you can easily beat them into shape should anything go wrong. It's also usually easy enough to adapt how things are done in one Linux distribution to another, but Nix is weird and takes a long time to figure out. (Nix stuff itself being expressive enough that there's often more than one way to do things).
- gugagore 5y ago> It's about how much of a pain it is to get things working when things aren't nice and you don't know what to do. Thank you for highlighting this. I love elegance, safety, reproducibility, declarative specifications, etc. But the minute I get the sense of "this philosophy is getting in the way. I am stuck, even though I know exactly what to do below this layer of abstraction", I get very annoyed. That's why I asked about "escape hatches" in a sibling comment.
- kaba0 5y agoWorst case just run chroots, or docker for the rare case something really don’t want to run under Nix. But it rarely happens anymore, it has a huge ecosystem with almost everything packaged so depending on how niche is the thing you work on, it can be a really comfortable environment.
- toastal 5y agoThere would be less friction if say NPM and package managers like these weren't installing files in random places, assuming locations of files/binaries instead of querying, let libraries and binaries be configurable, and/or not following the XDG spec. This is probably what developers should be doing, but many can't be asked to understand Ubuntu isn't the only Linux distro.
- mekster 5y agoMaybe figure out why none of the cloud providers provide Nix as their install OS image. If that happens, users will easily double and maybe more hands might fix the docs or perhaps it's a chicken egg problem but if it's the doc, it's easily solvable.
- kevincox 5y agoThat is easy. It is unpoplar and not compatible with popular images. The default image for a cloud provider is going to target the common use case and easiest way for a novice to get started. If you already know what you are doing you will select a custom image anyways.
- scintill76 5y agoRunning something like nixos-infect to convert an Ubuntu machine into NixOS is going to be a new user’s easiest part of using NixOS. After that, it’s a pretty steep learning curve (or a tutorial) to do anything interesting. I’m doubtful that deleting that first step would bring more users.