Live data from Hacker News

NixOS 21.05

nixos.org

111–120 of 234 posts

Re: NixOS 21.05

#111

Earlier quoted context omitted.

So if I understand correctly, I could declaratively specify my workstation, say I want vim, podman, codium, kubectl, curl, tmux, firefox, zettlr. I could put this in a configuration and have my workstation anywhere I can grab that from? Is there some way I can boot-to-git-configuration? So I could do this in RAM on someone else's hardware, like a network boot?

> So if I understand correctly, I could declaratively specify my workstation, say I want vim, podman, codium, kubectl, curl, tmux, firefox, zettlr. I could put this in a configuration and have my workstation anywhere I can grab that from? Kind of. It works very well if you own multiple computers that you want to be configured similarly (like a dotfiles repo on steroids). It doesn't work so well for I borrowed my cowo…

> However, Nix does also supply the "nix run" command, which allows you to use software without installing it permanently (but without NixOS' configuration support).

What do you mean without config support? It runs a nix derivation which can be arbitrarily complex. Do you mean your /etc/nixos/configuration.nix file? Because you are not really using it either, only for creating a derivation that will become your system. A nix-shell of a user will by default use the user’s channel and may not do anything with the global config.

Re: NixOS 21.05

#112
post #62

Earlier quoted context omitted.

> how painful was it to learn and get working? nixpkgs (which you can use on macOS or any Linux distro), quite little, you can get up to speed in 15min as a Homebrew replacement: nix-env -qas ruby # 'q'uery 'a'vailable 'search' nix-env -I ruby. # install by package name (not recommended) nix-env -iA nixpkgs.ruby_3_0 # install by "attribute", recommended nix-env -q # 'q'uery (i.e list installed) nix-env -e ruby # unin…

Please don't recommend that people use nix-env. It's one of Nix's biggest footguns and a huge support burden for the maintainers. We've been actively trying to remove mentions of it from the documentation. If you want something "installed" use home-manager. If you just want something for quick dev use nix-shell.

If nix-env is a big ol' footgun, are there any plans to make home-manager a part of the OS itself, instead of just a community project?

Re: NixOS 21.05

#113
post #99

Earlier quoted context omitted.

Yes, if Guix were "Nix but with Scheme" I'd go for it in a second. Unfortunately, although both Nix and Guix make hard choices about things (e.g. the init system), at least the choices made by Nix are more livable day-to-day. As to why Nix wasn't some system written using Haskell (for actual language features that is also lazy) or Prolog (for its whole thing about solving constraint-based problems all over the place)…

Would it be possible to write a CLI tool that translated Scheme into Nix-compatible config files? Presumably then you could alias Nix commands so they piped config 8n through the translator.

It might be possible, but a better approach (and the one Guix used initially, iirc) is to just be compatible with the derivation format (kinda like object files in C/C++ compilation). The end result is basically a big dependency graph, so one may be able to write a different generator in front of it.

Anyone who has done the basics in Prolog could "logically" pull this off (e.g. some rule requires another rule, or however Prolog works; it's been a long time since I looked at it), but all of the extra stuff in the library (e.g. all of the systemd tweaking, interface, etc) is a LOT of man hours.

I heard about Spack [0] on a recent cppcast episode, which seems like a competitor to Nix (but from the supercomputing side of things), but I don't know if they do the OS-level stuff (vs. nix shell / conda / pip / gem replacement stuff).

[0] https://spack.io/

Re: NixOS 21.05

#114

Earlier quoted context omitted.

Software 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…

Could 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?

As 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.

Re: NixOS 21.05

#115

Earlier quoted context omitted.

I really can't believe they didn't finalize Flakes in this release. The difference between it and the "standard" way of doing things is night-and-day. these sort of "secret better ways of doing things" that are not the default really frustrate and drive away new users

By the way things are, I doubt they'll be stable in next release either. There were some pretty fancy things in last year's NixCon so devs might just push on that. But the problem is, many many new shiny things are so comingles with flakes that they are now stuck in limbo, thanks to the one amazing feature that was showcased back in 2019 and then rotted away in implementation hell. Initial RFC was rushed, barely disc…

I wonder if there are any contentious design decisions left in flakes. I've still new to Nix, but it seems pretty solid (the only thing I've seen is that `nix flake info` is now `nix flake metadata` or something minor). The only missing thing I've seen is how to load a repl with flake contents easily, but I usually do:

nix-repl> builtins.getFlake (toString ./.)

when I'm in the flake directory. It would be nice to have `nix flake repl` as well.

Re: NixOS 21.05

#116

Earlier quoted context omitted.

For 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…

> 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…

Worst 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.

Re: NixOS 21.05

#117
post #21

Earlier quoted context omitted.

The documentation and the nix language are the worst things about the project IMO. I really hope Guix succeeds because Scheme is, in my opinion, a better DSL and language than this weird, not very well documented, Haskell-like derivative. Unless you've drank the kool-aid, you have to learn a completely new operating system and way of doing things, a weird language that's lacking on documentation, and a ton of system…

Nix and similar projects are all going to be eaten alive by immutable distributions, Flatpak and new projects - that might work just like Nix but get the user experience right, and make packaging and maintenance easier. And no I'm not saying they do the exact same thing, have all the same features or target the same type of users. For the developer tools side I like what Shopify did but I would never recommend that t…

I’m not too afraid of a niche being eaten alive by a slightly larger niche :D

Also, I don’t really see the value of flatpaks, they don’t solve the dependency hell problem (nix does) nor they are adequate sandboxes (be honest, linux has non-existent user-space security, it’s frankly terrible. And for some reason even flatpak is written in goddamn C in 2000+ something)

Re: NixOS 21.05

#118
post #53
post #19

Earlier quoted context omitted.

Honestly - how painful was it to learn and get working? And what limitations/niggles are left when using as a workstation? I love the principles behind Nix, and I like to use it to provide development environments (through nix-shell locally and then using the same setup in CI). But some things can be moderately painful to get going.

You're looking at a solid 10-20 hours of hacking stuff together to get a decent working system, and you still won't understand a good 80% of what you copied from various repos. I've been using NixOS for a year now, and I have a definite love/hate relationship. Many times I miss the simplicity of Arch, where I understood _everything_ about my system and how it was configured. NixOS is like learning everything all over…

Yes, it's extremely powerful once you truly understand Nix.

There are efforts to improve documentation, but it still is lacking (I think the biggest problem is that Nix is so big, not just the OS but it can be utilized as a build system).

Just with NixOS is not exactly clear how can you for example build your custom image.

I think https://nix.dev/ is approaching the documentation from the right direction.

There are also many pieces that people built that you need to find.

For example some things that I found accidentally:

* https://github.com/nix-community/poetry2nix

* https://github.com/matthewbauer/nix-bundle

* https://github.com/cleverca22/not-os

Unfortunately those side projects often have even worse documentation.

Re: NixOS 21.05

#119
post #30
post #4

I recently moved my laptop, desktop, and a few servers from Arch Linux to NixOS with flakes and home-manager. It is amazing! The complete configuration for all machines is in a single git repository, I can share configuration between them, and a `flake.lock` file guarantees all machines are using the same version of everything. No more trying to remember what command I need to run to install and configure software an…

Long time Arch user here but I'm growing more interested in NixOS by the day. I'm mainly “utilitarian” in my OS choice and other things being equal, Arch's AUR packages is what keeps me using it. How does the Nix ecosystem compare with AUR? Would you still recommend making the switch?

nixpkgs is of a very similar size to the aur (or even larger depending how you count), but is significantly more up to date: https://repology.org/

Re: NixOS 21.05

#120
A teeny-tiny orientation for (prospective?) Nix newcomers:

Having spent years on Arch and Gentoo, imo the NixOS community is outstanding even among 'advanced' Linux distros in terms of expertise and kindness.

I'll never forget one time I was having problems with a Python package generation tool and when I mentioned it on IRC, and one of its authors (Rok Garbas, who is so quite active in the community) just hopped on a call to debug the issue I was having right then and there.

If you're on the fence about Nix and that kind of community is valuable to you, make sure to check out the forums [1] and realtime chat [2] (the latter of which is unfortunately still in the process [3] of migrating away from Freenode).

If personal assistance/mentorship of the kind I described at the beginning of this post is appealing to you, several generous and knowledgeable community members host Nix ‘office hours’ [4]. I'm not sure who all are still running them, but I know tomberek is for sure [5] and you can find a link in the footnotes.

There is one serious problem with NixOS and the wider ecosystem right now, namely that the best experience available depends on Nix features that are unreleased. Nix makes it very easy to run bleeding edge builds of Nix and enable these features, but the unofficial status of it all has slowed adoption, integration, and documentation of these tools in the wider community.

That aside— i.e., if you're willing to be a little bit of a pioneer— the community is on the whole pretty rich with good documentation of everything but the bleeding edge, unreleased bits at this point. Those pieces mostly impact the CLI and specifying inputs to the expressions you use to define your system. Everything in the NixOS and Nixpkgs manuals is still accurate. The unreleased components are also fairly mature despite their unofficial status: many folks in the community have been using them for a year or two now.

Finally: if you're interested in dipping your toes in without committing to a system fully managed by Nix and you're a macOS user, nix-darwin [6] provides a pretty NixOS-like experience using a module system and CLI based on NixOS'. There's nothing equally complete in terms of managing system services in a declarative fashion on non-NixOS Linux, but home-manager [7] provides some functionality for enabling user-mode services in a declarative style.

You can check whether your favorite software is packaged for Nix here [8], and additionally NixOS does support several other forms of cross-distro packaging/deployment, including Flatpak, AppImage, and Docker. Steam support is native and works without much fuss, too.

---------

1: https://discourse.nixos.org/

2: https://matrix.to/#/!MKvhXlSTLGJUXpYuWF:nixos.org

3: https://github.com/NixOS/rfcs/pull/94

4: https://discourse.nixos.org/search?q=office%20hours

5: https://discourse.nixos.org/t/nix-office-hours/11945

6: https://github.com/LnL7/nix-darwin

7: https://github.com/nix-community/home-manager

8: https://search.nixos.org/packages

Post reply on HN