Live data from Hacker News

NixOS Linux

nixos.org

31–40 of 82 posts

Re: NixOS Linux

#31

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.

Nix supports containers as a build target or output format, but the nix tools are considerate (easy to uninstall) so there's no need (& little sense) in putting them in a container. You could run the nix install script in a ubuntu or alpine image.

I use Nix on macOS, wishing I could replace all my brew usage with it. Working on a home-manager derived setup.

The dev workflow mentioned by tikhonj https://christine.website/blog/how-i-start-nix-2020-03-08 (including a "derivation" building a container from the example project).

https://nixos.org/guides/nix-pills/

Re: NixOS Linux

#32
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've had sufficient success cd'ing into the project directory, activating my nix-shell, and then launching VS Code from inside that shell. In which case it inherits the shell's environment and most things work as expected.

There's surely a better way to do it, but I tend to prefer vim + lots of terminals over VS Code, so I haven't looked too closely at that workflow.

Re: NixOS Linux

#33
post #6

Earlier quoted context omitted.

If any of software relies on different versions, yes. It beats not being able to use something because you can only have one version of a library shared.

How does this work with compiling software. For example, I routinely compile programs that use different versions of openssl. Does NixOS make this process any easier.

This is the killer use case, and the initial primary(?) design justification.

https://nixos.org/guides/how-nix-works.html

https://edolstra.github.io/pubs/nixos-icfp2008-final.pdf

Re: NixOS Linux

#34

I use Void now and like not having systemd. Can I install Nix on my Void? Do I then just stop using the native package manager? Or would it be better to install NixOS? Could I then choose not to use systemd? Would that be hard? Is the idea that you can define your system in a file and reproduce it more or less automatically? How does this compare to Guix?

> Can I install Nix on my Void?

Yes. (And you won't need to use systemd with just Nix and Nixpkgs)

> Do I then just stop using the native package manager?

No

> Is the idea that you can define your system in a file and reproduce it more or less automatically?

Yes

> How does this compare to Guix?

Very similar. Guix is a fork -> rewrite, with more Scheme and more FSF policy. But core concepts have not diverged.

Re: NixOS Linux

#35
post #28

Earlier quoted context omitted.

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…

Second this. It's mostly been a pleasure, but Steam is a mess. And I just gave up on Android development on NixOS; I used a Ubuntu VM for that. But starting off with a new computer, copying over a config file from one of your existing files, building...and ending up with _exactly the same system_, including all those tweaks to _this_ file and _that_ config, and the cronjobs you've set up over time, and all your diffe…

Steam works fine for me. Also, the "NVidia prime" stuff from https://nixos.wiki/wiki/Nvidia works out of the box since 20.09. (Though i will be happy when Dell finally sells AMD graphics instead.)

Also I've made android packages (albiet ones that don't use much Java) using the Nixpkgs repackaging of the Android SDK.

Re: NixOS Linux

#36
post #2

Just to see if I understand, does this mean you might end up having dozens of libcurls?

You could or you couldn't. It's your choice:

- Traditional distro: you cannot end up with that

- Flatpack, snap etc.: you cannot avoid that

Nixpkgs doesn't wontonly package multiple versions of libraries. But as you upgrade you will accumulate old builds of libraries until you GC. The meaningful question is not how many of X do you have installed, but whether you have multiple versions of X reachable from GC roots.

Re: NixOS Linux

#37

I use Void now and like not having systemd. Can I install Nix on my Void? Do I then just stop using the native package manager? Or would it be better to install NixOS? Could I then choose not to use systemd? Would that be hard? Is the idea that you can define your system in a file and reproduce it more or less automatically? How does this compare to Guix?

You should probably be able to run Nix on Void. It might get awkward running two parallel package managers, but I've heard good things.

The idea of Nix is that you can specify a package's dependencies very explicitly, and have it build in a hermetic, and reproducible, environment. It can handle all sorts of dependencies, be they same-language libraries, binaries, or native system libraries. You can think of it sort of like firing up a docker container in which to run your build--if it works once, it'll always work, and if it works here it should work everywhere.

NixOS adds to that by essentially making the running system one of the packages managed by Nix. You specify what packages should be installed, how those packages should be configured, what services should be run, users that should exist, etc. When you build, the operating system you're running on is replaced with the new one. If anything breaks, you can trivially roll back. If you build the same config on a different host, you'll end up with the same system (albeit with slightly different package versions).

Guix is basically a fork of Nix (or started that way); it's got a very similar approach to Nix (and GuixSD to NixOS). It uses Gnu Shepherd instead of systemd, and uses Scheme for system config instead of a custom language.

Re: NixOS Linux

#38
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?

edit: this is how my vscode is configured using nix on top of Xubuntu:

vscode is installed globally using the buildEnv-based declarative user environment approach (https://gist.github.com/lheckemann/402e61e8e53f136f239ecd8c1...). Then in individual projects I include language-specific dependencies such as dotnet-sdk_3 or google-cloud-sdk.

Re: NixOS Linux

#39

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.

Re: NixOS Linux

#40

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

Post reply on HN