Live data from Hacker News

NixOS Linux

nixos.org

41–50 of 82 posts

Re: NixOS Linux

#41

Can anyone talk to if nixos can reasonably be used to run a desktop setup?

As long as what you want to do is already in nixpks it's extremely easy, once you stray from that you need to start learning how all of it works, it's not the best in terms of documentation & straight forward concepts, but I've been running it at my main desktop for 6 months now. Sometimes it shines ex: I messed up my x11 config as well as drivers and just booted into the previous generation like it was no big deal I…

> Lots of steam doesn't work out of the box compared to Ubuntu.

Make sure you're using Proton 5.0 until this [0] is fixed.

[0]: https://github.com/NixOS/nixpkgs/issues/100655

Re: NixOS Linux

#43

I played with NixOS and am willing to admit that it was too difficult. It's probably great for devops, but it's just slightly too rigid for my own personal use. Let me give an example: let's say you want to use xmonad on top of Plasma. NixOS doesn't have any simple way to configure that. You have the mutually exclusive options for one or the other, basically. I know Nix is powerful enough to do this, if I wanted to g…

> xmonad on top of Plasma I gave up on XMonad + Gnome before I switched from Ubuntu to NixOS 6-7 years ago. Does XMonad + KDE work? I would love to get such combos working in NixOS / home-manager. (We also need to bite the bullet and get X-less Wayland working properly. I think I might be tempted to plan everything out at once so we don't get conflicting refactors or too much complexity.)

I was using XMonad+KDE on NixOS just fine for about a year at my old job.

Re: NixOS Linux

#44
Kind of off topic, but I would love to have NixOps (https://github.com/NixOS/nixops) as an abstraction layer for every type of cloud service, and not just virtual machines (e.g. queues, object storages, etc).

There is Terraform and Ansible, of course, but Nix seems like it could combine the strengths of both of them.

Re: NixOS Linux

#45
Before installing NixOS, I’d recommend anyone on Linux to give home-manager a go first for the userspace declarative approach with Nix. After a year with full-time NixOS, I switched back to Ubuntu + home-manager as best of both worlds—declarative when feasible, imperative when convenient.

[1] https://github.com/nix-community/home-manager

Re: NixOS Linux

#46
I'd love to try Nix. But, I'm using an Nvidia Jetson environment, which is based on a preinstalled Ubuntu 18.04, probably with lots of specific driver configurations that I don't want to touch (or reinvent). I've also learned that running Nix on top of Ubuntu is not the greatest idea, see e.g. [1].

[1] https://news.ycombinator.com/item?id=16443323

Re: NixOS Linux

#47

I played with NixOS and am willing to admit that it was too difficult. It's probably great for devops, but it's just slightly too rigid for my own personal use. Let me give an example: let's say you want to use xmonad on top of Plasma. NixOS doesn't have any simple way to configure that. You have the mutually exclusive options for one or the other, basically. I know Nix is powerful enough to do this, if I wanted to g…

> Let's say you want to use xmonad on top of Plasma. NixOS doesn't have any simple way to configure that. You have the mutually exclusive options for one or the other, basically. I was pleasantly surprised to find the contrary to be true: in my experience, NixOS is the only distro to give you _every_ DE+WM combination pre-generated as a login session that you can pick from the display manager.

Still waiting on LDM...

Re: NixOS Linux

#48
post #9

The big idea in Nix is the view that the filesystem is like mutable memory in a programming language. You wouldn't give access to memory raw without any safeguards. (Typical package managers can just arbitrarily dump files or remove files) It takes a structured approach. Laying over a graph database on top of your filesystem which is read-only typically. This helps provide guarantees and also every application has it…

I love the guarantees given by Nix (I'm an immutable/functional-lang dev, Elixir specifically, so I really do get that), and I get that introducing a certain amount of complexity is sort of unavoidable when going in this direction (similarly, functional languages have a learning curve), but Nix for some reason still isn't clicking for me- I don't know if its UI is just terrible, its learning curve too steep, or something... but it's the sort of thing you can't just dabble in, you have to commit 200% to... and I think that's asking a lot of people. To use the cost/benefit analogy of functional languages, it feels like Nix has a much steeper cost to get the (admittedly unique) benefit of a completely deterministic software stack.

Re: NixOS Linux

#49
post #14

Earlier quoted context omitted.

> Using a special command (nix-shell) whenever I needed to do development things (e.g. Rust builds) was not my idea of fun. Funny you should mention that, because that's exactly what got me using Nix everywhere :). I've always hated installing tools and libraries globally—what if I need a different version for a future project?—so I like tools that sandbox as much as possible like virtualenv, cargo, cabal... etc. But…

Out of interest, how does this work if using something like Visual Studio Code or some other IDE?

I use Emacs's direnv integration. Haven't had any trouble. It straight-up works better than alternatives I tried before like trying to turn pyvenv mode on automatically.

I also manage Emacs, its packages and its packages' native dependencies with Nix.

Having an automatic link between Emacs packages and native libraries has made my life massively easier. For example, earlier today I installed `pdf-tools`[1] just by adding (use-package pdf-tools :ensure t) to my init.el, and Nix took care of building and installing the native software needed to support it. I didn't have to go through any of the installation steps in the pdf-tools README[1], it just worked.

I'm on my laptop now, but when I get back to my desktop, all it will take to get pdf-tools working is pulling the latest version of my config from git and switching to it. As long as there's a version of the native libraries packaged for macOS, getting it working on my work laptop won't be any harder; if there aren't, I might either change the config to only have that package on Linux or I might write a bit of Nix code myself to build a macOS-compatible version.

pdf-tools is a cute self-contained example, but this has been even bigger for using lsp-mode and different language servers as well as other nice-to-have development tools.

For all the hassle that learning and moving to NixOS took—and still occasionally takes—I'm convinced that things like this have more than paid off for me and that I'm saving time on net.

[1]: https://github.com/politza/pdf-tools

Re: NixOS Linux

#50

I tried to use nixOS as a desktop system. Using a special command (nix-shell) whenever I needed to do development things (e.g. Rust builds) was not my idea of fun. Some other things, like overriding GDM's monitors.xml file, were pretty much impossible to do. Maybe it's better if you just use it as a base for servers / containers.

Has the container situation improved? Last time I looked (quite some time ago) I couldn’t find an official or community blessed container to base anything on.

I've used the nixos/nix image from Docker Hub[1] to run some CI scripts using Nix to build my projects.

As far as I understand it, it's basically Alpine Linux with the Nix package manager and tools preinstalled, but it worked pretty well for me.

[1]: https://hub.docker.com/r/nixos/nix/

Post reply on HN