11 ms·
How Nix and NixOS get so close to perfect
- dmitriid 5y agoSomehow 60% or more of the presentation is spent on what is charitably called "papercuts": bad tooling, bad documentation. It's not "getting so close to perfect". A jet-powered cart (from the comic in the presentation) is not "close to perfect" by any imaginable criteria. Well, unless your idea of perfect is "a jet-powered cart".
- Athas 5y agoI feel differently: when proponents of a thing are open about its flaws, and those flaws are not in the fundamental ideas or principles of that thing, then it makes me more convinced that perhaps the thing does have merit. (Although I can buy the argument that it's not close to "perfect", mostly because I have no idea what perfect package management would look like.)
- zoul 5y agoMaybe having terrible UX is starting to look like a fundamental flaw here? I know that UX sounds like something that should be “polishable”, but at this moment I have been hearing for years about Nix being great in principle but not that great in everyday practice. (Cf. Linux on desktop…)
- colordrops 5y agoI'm not convinced that Nix isn't polishable. Because the language is declarative, and can be pure if using flakes, it could readily be extended with simple tooling and UI configuration that make it look and feel like other distros, with the more low level constructs still available to advanced users. It's still in a phase where most users are power enthusiasts, so polish hasn't been priority #1, but someone will come along and make a more friendly wrapper one day.
- deleted 5y ago[deleted]
- NateEag 5y ago> It's still in a phase where most users are power enthusiasts, so polish hasn't been priority #1, but someone will come along and make a more friendly wrapper one day. As a diehard Emacser, Emacs has been waiting about thirty years for someone to make it a prettier wrapper. It's possible to be so power-user-friendly that in practice no one wants to make it end-user friendly.
- sph 5y agoIn my experience UX and polish is something a project needs to start with. You don't polish after the fact, because software is never completed. Saying "we'll improve documentation eventually" often means "we will never improve documentation"
- TheOtherHobbes 5y agoYou can only work with what something is. Not with what it might be, one fine day.
- Athas 5y agoSure, but e.g. the documentation problems with Nix don't prevent you from working with it. While the problems make it less smooth and productive than it otherwise might have been, it might already be better than legacy systems for you. In particular, Nix can be used in a non-invasive add-on manner on ordinary distributions. We have it installed on RHEL servers at work, where it is used exclusively as a build system and for "userspace programs" (not in the kernel sense, but in the sense of programs that are not core to the functioning of the system).
- dmitriid 5y ago> Sure, but e.g. the documentation problems with Nix don't prevent you from working with it In a world where there are thousands of things for me to learn (many of them with poor documentation), Nix is just one such thing. The question is, do I care about its purported benefits, and sink my time and effort into it, or should I sink time and effort into learning Unreal Engine, playing Rimworld, or going for a walk? So far, for me (and most of the world) the last three (and the rest of the thousands of things) win over Nix.
- bspammer 5y agoDoesn’t it say something about how useful nix is when you have all these smart people complaining about its warts (and it definitely has quite a few) but still using it? It is the way I’ve always wanted a package manager to work, and it really does work. It feels insane to use anything else now, I can’t go back.
- dmitriid 5y ago> Doesn’t it say something about how useful nix is when you have all these smart people complaining about its warts (and it definitely has quite a few) but still using it? No, not really. Tech people especially are susceptible to sunk cost fallacies We also get the kick out of conquering complexity.
- atoav 5y agoAs someone who really would like to have something like nix the thing that scares me away every time is the fact that the people creating this aparently did not think a lot about how to onboard users. And I don't mean a lack of documentation — what I mean is that the obvious decisions that have been taken (naming everything "Nix", using Haskell as a base for the syntax, ...) don't really fill me with confidence that in other spots decisions have been made in a logical and/or straightforward way. I am trying to have a less terrible experience with dependency and configuration management — but what I am not trying is making dependency and configuration managment my nerdy hobby. I have enough nerdy hobbies already. So in short: My worry is that the seemingly big investment in terms of time is not worth the advantage this might give me over e.g. a traditional debian system. The thing is: I really, really want an system that does the things nix does, but nix doesn't seem to be it. I am grateful about the honest presentation, but if nix is really the future, these paper cuts have to be dealt with.
- xena 5y agoI've been working on things to help onboard people. If you wanted something to help onboard you with NixOS, what would you want to see?
- deleted 5y ago[deleted]
- viraptor 5y agoDifferent person, but trying to recall my initial painful experience: "Use case -> how to achieve it", more than "functionality -> how to use it". Nixpills seems to flirt with both concepts, but also is a bit... showing off? Just plain "I've got this app, how do I package it", "how do I overlay it", "why are there 5 ways of doing overlays that people use differently", "what is the actual expected signature of various flake elements", "what packaging helpers are available and how do I find them", ... would be amazing. I have issues with nix docs trying to be clever. For example https://nixos.wiki/wiki/Overlays https://nixos.wiki/wiki/Overlays - "Careful, we're using a different self and super here!" - ok, then name them something more descriptive!
- 5y ago
- colordrops 5y agoI'm curious what was used to make the avatar in that presentation.
- mkl 5y agoOne of several different painting apps (click the images to see which): https://christine.website/gallery https://christine.website/gallery
- xena 5y agoAuthor here. That was VSeeFace. I have been doing a lot of research and iteration on using vtubing avatar software to try and make it feel more "natural" without getting too far into the uncanny valley. I think I'm almost as a happy spot, but I'd love to have hand tracking so I can gesture around. I need to get my hands on a leap motion and 3d print a stand for it.
- k__ 5y agoIt's kinda ironic, the biggest innovation in package management and OS design is basically unusable for the average tech person. Compared to Nix, every other package manager is a security liability.
- microtonal 5y agoCompared to Nix, every other package manager is a security liability. Nix is great, but I don't see much difference with respect to security. In fact, Nix encourages and flakes formalize pinning of nixpkgs versions. I am sure that there are a bazillion repositories/configurations out there that use a pinned nixpkgs version with known vulnerabilities in glibc, libxml, or whatever. Besides that, packages in nixpkgs often have known vulnerabilities for months, because of a lack of volunteers to maintain all of nixpkgs. I love Nix and the large amount of work that goes into nixpkgs. But let's avoid every Nix discussion becoming a 'Nix evangelism strike force' has landed kind of thing. Be honest about Nix' strengths and weaknesses.
- k__ 5y ago"packages in nixpkgs often have known vulnerabilities for months" Garbage in, garbage out. It would be nice if Nix could make vulns go away entirely, but you can't keep people from creating buggy packages.
- phaer 5y agoYou can't make them go away, but you can follow upstream for security fixes as close as possible and communicate them as good as possible. Nixpkg does quite a good job in tracking those issues, imho. https://github.com/NixOS/nixpkgs/issues?q=is%3Aopen+is%3Aissue+label%3A%221.severity%3A+security%22 https://github.com/NixOS/nixpkgs/issues?q=is%3Aopen+is%3Aiss... is a list of security issues. Most of them generated by automated scans of nixpkgs-unstable. But as far as I am aware, there's no mailing list or so for receiving notifications upon critical vulnerabilities(?). https://nixos.org/community/teams/security.html https://nixos.org/community/teams/security.html mentions github issues, discourse and matrix. Triaging security issues requires significant work and it's a task even more traditional distros like Debian often struggle with. One thing I'd like to see eventually is an option to nixos-rebuild and other to emit warnings if installed packages are affected by known vulnerabilities. I think that should be doable and would maybe raise awareness and provide most visibility to the issues affecting most users. https://github.com/flyingcircusio/vulnix https://github.com/flyingcircusio/vulnix does something like this, but it's currently a third-party tool
- deleted 5y ago[deleted]
- GekkePrutser 5y agoI don't think it's very perfect at all. It clearly appeals strongly to people managing cloud servers because it's basically the same kind of technology as Ansible or the many alternatives. Makes sense to use the same kind of tech you know through and through on your desktop as well. To me personally it doesn't really have much appeal.. Being able to replicate my desktop from scratch is not something I need often. And when I need to make a config change I don't want to bundle that with a package upgrade. Even for my servers I don't subscribe to the "cattle not pets" ideology. I just mean to say it's close to perfect for its target userbase. But different ones exist and this seems to often be forgotten by Nix evangelists. It's a good tool for some jobs but not for all.
- jordanbeiber 5y agoI probably appeals most to developers as sharing application development environments with shell nix files is totally awesome. I must say that using nix on my primary workstation makes it feel like an appliance. The system generation roll-back have saved me a lot of times when an application update brings a regression.
- GekkePrutser 5y agoThat makes sense, I never need to share my config with anyone else. Also I love the ability to mix packages with source compiled software, which is one of the reasons I use FreeBSD on my primary desktop. It does that combo really well with its ports collection.
- ravi-delia 5y agoI feel like FreeBSD is almost this middle ground between a typical package managed (?) system and something like Nix. I didn't wind up needing that middle ground, but just the few months I spent with it made it clear how well-designed it is. Only on Nix have I written and modified my own packages that much, and that's partly out of necessity.
- 5y ago
- avodonosov 5y agoWhat is the Nix approach to config files? I understand it allows for stable binaries, without dependency hell, easily installable, possibly multiple versions of the same package; and for easy rollback of the installations. Because code modules are versioned by hashes of their full dependency tree and build options. But configuration files? I once installed the Nix package manager on my Ubuntu, and installed some apps with it. Nothing worked. Because some files I have in /etc/ were not compatible with Nix versions of the applications. Those configs were about some deep mechanics of X-related libraries. I never edited them and I don't understand their function. So, it was impossible to use Nix packages side by side with my Ubuntu. And I suspect the same can happen on plain Nix OS with multiple versions of one package. Probably I am missing something, but that does not look perfect.
- jordanbeiber 5y agoConfiguration of applications are usually exposed as properties by package maintainers. What I like about nix is the complete ”as code” approach - I usually look in the the package repo for the properties. A couple of times I’ve had to escape hatch and write to a config file using a nix expression.
- maxxk 5y agoI know of least three approaches: 1. For per-user configuration there is home-manager which symlinks dotfiles to Nix store based on a single "home.nix" derivation (state). Home-manager is usable outside of NixOS and, in my opinion, it is better than most dotfiles managers. https://github.com/nix-community/home-manager https://github.com/nix-community/home-manager 2. In NixOS /etc is composed in the same way from the system derivation. 3. Outside of NixOS, I think, one can build systemd units which refer directly to configuration files in Nix store. Probably one can add config paths into wrappers, but it will be very fragile and won't scale.
- avodonosov 5y agoUpdate: I recalled what didn't work - Firefox had very ugly fonts. So it's not exactly as I said "nothing worked", just the result of the Nix try was unusable for me.
- Yaina 5y agoTwo years ago I tried to set up my home-webserver with nixOS. I failed miserably. The post hits the nail on the head: The documentation is horrible, and barely differentiates between the language, the package manager and the OS itself. I really like the idea behind nix; maybe something with better execution comes up one day :)
- exdsq 5y agoI’m holding out for this - Nix is the only tech I veto in startups I work at nowadays because I’ve never seen it go well beyond small dev scripts, and time spent on Nix is time taken from the product/project.
- encryptluks2 5y agoI'm starting to see more of a cult attitude with Nix. It is like the Arch Linux crowd (I use Arch) but much worse. I think is is great that Nix has provided something valuable to a lot of people, but so does a lot of software and tools. Nix fills a void in package management. It is like Ansible or Terraform for a semi-idempotent distro. It is probably quicker in most ways than building something similar with other configuration management tools, but I still prefer other tools because the language for Nix is just bleh. Had they went with a simple YAML format or HCL, then I'd give it a chance, but because they didn't I'm certain eventually someone will create something better learning from the mistakes of Nix.
- xena 5y agoAuthor of the post and survivor of several cults here. Nix is nothing like a cult. There is no behavior control, information control, thought control or emotion control at work. There are just people that are passionate about the tool and want to see it thrive. I would hardly call this a cult, more of just an interest group with weird nerds in it. Honestly after a while the language starts to fade into the background and you just focus on what you are doing. Keep in mind that I am an expert at this point and have prior experience with Lisp, Haskell and a little bit of ML; so the overall flow of the configuration language and the like is easy for me to feel my way into. I have been trying to work on documentation to help get people up to that level; but trying to explain things you understand intuitively is hard :) I'm trying though. With my Nix flakes series I'm probably going to rebase a lot of it around using NixOS with WSL to make it easier to approach for newcomers.
- thrown12 5y ago
- viraptor 5y agoSurvivor of a cult does not necessarily mean that someone joined a cult themselves. Kids escaping environment they were born in may be survivors of a cult. People with spouses who joined a cult may be survivors. Environments may change, leaving a mainstream church in a specific area may mean leaving a cult. Etc. Don't look down on them unless you know all the details.
- mmargerum 5y agoI thought guile was the language used. maybe im confusing this with guix
- goosedragons 5y agoYes, Guix uses Guile. Nix uses it's own thing.
- 0des 5y agoIts
- alberth 5y ago>> "bad documentation" One thing I still can't figure out is if nix (or flakes) allows you to pin packages to a specific version. Does anyone now if that's possible and how? E.g. (pseudo code below) services.nginx.version="1.21.4" services.nginx.enable=true
- xena 5y agoYou'd really need to set the package to a specific overridden version of nginx. See here for how to make such an override: https://blog.thomasheartman.com/posts/nix-override-packages-with-overlays https://blog.thomasheartman.com/posts/nix-override-packages-.... Then you would set `services.nginx.package = pkgs.nginx.override ...;`.
- alberth 5y agoThank you so much.
- xena 5y agoNo problem. If you have any more questions please get in touch on https://christine.website/contact https://christine.website/contact. This shit needs to be so much easier than it is. I'm also @xena on keybase if that's your tool of choice.
- alberth 5y agoOne more random question... What's your thoughts on a NixOS like operating system for FreeBSD? And have you seen any development effort for it (I don't mean the package manager for FreeBSD which already exists). Frankly, FreeBSD being an entire operating system with userland included seems way more appealing to me than Linux based NixOS - since it seems like reproductability would be even easier/stronger for BSD than Linux.
- xena 5y agoIt would be a really cool thing to see a NixOS like FreeBSD system done, but I really don't have it in me to do such a thing. It would make BSD more usable for me, save the lack of a solid service management framework like systemd. As far as reproducibility goes, in practice most of the invariants that are not reproducible go down to people embedding way too much metadata into things for no good reason. A BSD base would certainly remove a bunch of variables, but it's not magic reproducibility sauce.
- BaculumMeumEst 5y agoI’ve been trying out GUIX, but I wasn’t able to figure out a good way to do rust development on it. Tools like Cargo and Rust analyzer are extremely useful but introduce a lot of complexity which doesn’t seem to mix well with functional package managers like guix and nix.
- xena 5y agoIn Nix land I've been using naersk[1] to build Rust packages into Nix packages. Here's a minimal example of a Nix project that uses Rust, Naersk and puts cargo/rust analyzer in the devshell environment: https://tulpa.dev/cadey/printerfacts https://tulpa.dev/cadey/printerfacts [1]: https://github.com/nix-community/naersk https://github.com/nix-community/naersk
- tazjin 5y agoWe use naersk[0] for Rust projects in our Nix monorepo (for example [1]). It's pretty hands-off in terms of the Nix code needed (you don't need to pin hashes inside of the Nix code as long as you have a Cargo lockfile) and all the existing tooling keeps working fine. The main drawback of it is that it currently builds all of your dependencies in one big derivation, so any dependency changes cause a full rebuild. There's some other project I saw fly by which attempts to do a similar thing but split each crate into a separate derivation, but I forgot what it's called and have no experience with it. [0]: https://github.com/nix-community/naersk https://github.com/nix-community/naersk [1]: https://cs.tvl.fyi/depot/-/blob/ops/journaldriver/default.nix https://cs.tvl.fyi/depot/-/blob/ops/journaldriver/default.ni...
- Avamander 5y agoBut the current NixOS approach is terrible for maintainers and developers, there are so many that get burnt out due to the constant churn and lack of regression prevention.
- SkyMarshal 5y agoCan you elaborate on churn and regression prevention? Haven’t heard of those issues before, but I’m relatively new to Nix.
- Avamander 5y agoThere have been multiple discussions on the topic, for example: https://discourse.nixos.org/t/nixpkgss-current-development-workflow-is-not-sustainable/18741 https://discourse.nixos.org/t/nixpkgss-current-development-w...
- lysecret 5y agoHmm I don't know Nix very well. But the features described in the blog post. Aren't they very similar to the features of docker ? And docker doesn't hat all of these "paper cuts".
- jbboehr 5y agoDocker has it's own "paper cuts." Such as only being able to cache sequential build steps, not being very reproducible, etc.
- eitau_1 5y agoMy two greatest gripes with nix (or rather nixpkgs) are: - so much things are implicit - inversion of control on steroids Besides, I love NixOS. EDIT to elaborate: when you try to read how various things are packaged, it's hard to know where certain things come from (`with` statement isn't helping); you wonder, how on earth can it work when it's mostly empty; names of some functions don't appear in files they're defined.
- amelius 5y agoHow well do they deal with GPU and less popular targets (e.g. embedded systems)?
- watusername 5y agoFor GPUs, very well I would say. If you have an NVIDIA GPU, all that's needed to use the proprietary driver is: { nixpkgs.config.allowUnfree = true; services.xserver.videoDrivers = [ "nvidia" ]; } (see also https://nixos.wiki/wiki/Nvidia https://nixos.wiki/wiki/Nvidia) For embedded systems the roads are certainly less traveled. There is decent support for several popular ARM SBCs (https://nixos.wiki/wiki/NixOS_on_ARM https://nixos.wiki/wiki/NixOS_on_ARM), and you can get it onto others with some elbow grease. The official binary cache only provides binaries for aarch64, so you will have to compile everything yourself for 32-bit ARM.
- smasher164 5y agoI think Spack[1] might address some of the problems surrounding Nix. It uses python to configure packages, and the upcoming release will have Windows support too. The "Getting Started" information is pretty helpful, but package-level documentation still needs some work. [1]: https://spack.readthedocs.io/en/latest/ https://spack.readthedocs.io/en/latest/
- senorsmile 5y agoThis is interesting. Thanks for the link.
- kkfx 5y agoI'm on NixOS since maybe five years and still being unable to digest Nix language and Nix* evolution, not that impede to profit from a functional OS design, it's my daily driver, but... I hope for Guix System but so far it's community seems not really more focused than Nix* ones, they are deeply INRIA/HPC centric not much valuing desktops and desktops needs for what I've see and lack of stuff like full LVM support built-in, zfs support does not help much, so so far I judge it not much mature enough for my desire. Guix docs are far better than NixOS ones, however there are no "books alike docs" from zero to sufficiently acculturated in Guix/Nix witch is a big issue IMO. However they are undoubtedly the future, there is no other sustainable model for the modern world but them. Modern container-mania can't scale down to system level and it's not much better than full-stack virtualization on x86 few years ago, a current fashion with no valuable technical reasons to be, modern packages manager around them (like snap, appimage, flatpack) are just crap needed to push commercial crap in FLOSS world, sorry for being rude, but that's is. Just look at their repo (including things like naming them store) how outdated they are in bundled deps, how many holes punched around they "security by isolation" model to make them usable and still they can't scale. Classic package managers came from another era, are in use, but not much sustainable anymore so...
- lab14 5y agoI’m a Staff Software Engineer in a Fortune 500. I’ve delivered a multitude of complex projects to production. Trying to setup Nix made me feel dumb and incompetent.
- Phurist 5y agoCorporate success and Computer science success do not go hand in hand always
- n42 5y agoSo you found a concept that didn’t come naturally to you. If you are as successful at this field as you want us to believe, you would probably have learned by now that all technologies click differently for different people depending on the context they bring in when learning it. I can’t imagine taking myself so seriously that I would write a comment like this. This is an opportunity for self reflection more than a lesson worth sharing about Nix.
- mplewis 5y agoThis sort of attitude is what keeps Nix from reaching a wider audience.
- deleted 5y ago[deleted]
- n42 5y agoWhat’s your title and your employer’s market cap? I need to know how seriously I should consider your opinion.. Yes, Nix is incredibly complicated and needs to improve to see more adoption. I was just commenting on the weird flex of the OP.
- HowTheStoryEnds 5y agoFor me it was documentation: I don't mind having to look things up with a new system but there does need to be a clear place to look the current things up. Instead I had to resort to Google which pointed to out of date solutions and package-names. Reducing everything to 'pin the tail on the donkey' for me and impeding me getting the system I want. And I love the idea behind it and the programs only available within X directory encapsulation but for me the docs just weren't clear enough when I tried. I should try again. :-/
- mamcx 5y agoI changed a mix of dockerkiles, shells, configs and others things to a SINGLE nix file. Is truly great. About complains: - Nix as "language": Is stupid, that is true. As any other stupid language on this space, name it: bash (TERRIBLE), docker, yamls, pseudo-TOMLs, etc. So is not that worse than the median. I wanna know what other real option is here, except use a language as python instead. - Documentation: Is not lack of it, is how spread and badly stitcher together. is like docs made by JavaDoc. But I remember Docker at first, and I waste as much googling as with nix. Docker is not intuitive at all, and worse, it change per distro! The actual thing is easy, and the best thing is just look at the code. Most of it is not that hard to figure than docker files, yamls, etc. What was very confusing is the idea of how each config are done. Exist many things that are not "together" like setup NGINX also need to touch the firewall, then maybe systemd. Is not different to deal with unix, that is a mess, is that at first you think all is "just work" by default. More exactly: Not exist a clear convention that is applied everywhere. Lack of uniformity is the main trouble. Still, same as other tools in this space. Also: Very hard to debug things. Also 2: The hack around "home manager" to manage user config is a hack. Make not sense: I use too much time trying to do it "natively". Do it manually in *nix is so simple "just cat/touch this file in this path", so is the main reason I almost drop it. --- The whole migration for me take 1 week. That is not that much than before the first time I doit with custom docker files (One of the companies I work for before I use 2 weeks making it. This was when alpine/small containers were not as common as today). So, YMMV but the end-results is very nice.
- solatic 5y agoAs a NixOS user who loves Nix yet struggles with nixpkgs from time to time - The main issue is that nixpkgs is unapproachable to new users. Yes, there is the documentation at https://nixos.org/manual/nixpkgs/stable/ https://nixos.org/manual/nixpkgs/stable/ , and it is quite long. It's not enough. Every Nix tutorial basically starts off with "this is how you create a new package. You get your source with either ./. or by using a fetcher to download a release from the Internet. Then you use mkDerivation to package the release by writing the install scripts." OK, cool. Then you want to package a Go program. Cool, let's copy from an example in nixpkgs. Well, stuff in nixpkgs doesn't use mkDerivation, it uses buildGoModule, and it references weird SHA hashes for the vendor? How do you get those? So you go to https://nixos.org/manual/nixpkgs/stable/#ssec-language-go https://nixos.org/manual/nixpkgs/stable/#ssec-language-go and it doesn't explain to you how to get the vendor hash. It doesn't explain to you why nixpkgs uses buildGoModule and not mkDerivation. So you don't really know how to continue and you feel pretty stuck. The thing is, a) buildGoModule is a higher-level function that will return the result of mkDerivation in a way that reuses everything that is common to Go modules. So it makes perfect sense from the perspective of a maintainer who wants to reduce the size of nixpkgs as much as possible, which is already one of the largest Git repositories on GitHub. b) Nixpkgs library functions like buildGoModule, with the need to maintain the separate vendor hash, come from a desire to write pure Nix functions without network access, i.e. there is no need to re-download the vendored dependencies if they already exist in the local Nix store cache. Indeed, the fact that there is only a single vendor hash represents a pragmatic compromise; whenever any dependency changes, the entire vendored dependency tree needs to be re-downloaded and rebuilt; if the hashes of the individual dependencies were tracked, then Nix would understand to only download the dependencies which had changed. The reason why Nix can't compute the dependency hashes of each dependency internally, and only then try to check the Nix store and see if they exist there, is because Nix does not yet support recursive calls: https://github.com/NixOS/nix/issues/13 https://github.com/NixOS/nix/issues/13 (nearly ten years old). However, the RFC for adding support was finally merged: https://github.com/NixOS/rfcs/pull/92 https://github.com/NixOS/rfcs/pull/92 and so support will come soon enough. So basically: Given that most developers need to produce containers to ship to production, and Nix already makes it possible for developers to ship containers, Nix needs to make it easier for developers to build their services/programs in Nix. Program build support is already pretty great for some specific ecosystems (e.g. Haskell) but for most ecosystems (like the Go example above) it ends up being pretty frustrating for one reason or another, due to lacking language features. Once those features are developed, there's a lot of room to make huge improvements in the various lang2nix projects, and then much more of Nix's value will be accessible to developers.