News for hackers. Stuff that matters.
Re:Zero to Nix, an unofficial, opinionated, gentle introduct... by lynndotpy on Monday January 23, 2023 @12:04PM (#34491607)
I wish guides like these contained screenshots.

Do people use Nix for desktop OSes? As a VM they SSH into? A collection of config scripts that they don't directly issue commands to?

I certainly can't tell from a quick glance of this guide

Re:Zero to Nix, an unofficial, opinionated, gentle introduct... by flexiondotorg on Monday January 23, 2023 @12:12PM (#34491738)
Zero to Nix introduces Nix, not NixOS the operating system. So, there's not really a need for screen shots as Zero to Nix it teaching how best to install and use Nix on any Linux or macOS. For that, code snippets are convenient I think.
Re:Zero to Nix, an unofficial, opinionated, gentle introduct... by MikeTheGreat on Monday January 23, 2023 @01:04PM (#34492507)
From the questions in the parent post I wonder if it would be good to have a clear definition of what Nix is, what NixOS is, how they're different, and when to use each? Could just be a short paragraph, but if the site is for people just starting out it might be helpful...
Re:Zero to Nix, an unofficial, opinionated, gentle introduct... by rprospero on Monday January 23, 2023 @12:21PM (#34491868)
I can tell you that I do all three. My daily driver is a laptop running NixOS with a highly customised desktop environment. I also have a small VPS that running NixOS that I communicate with via SSH. Finally, as work, we use a nix flake to simplify our build system. Most days of the year, that is handled entirely by the CI script and I don't have to think about it.
Re:Zero to Nix, an unofficial, opinionated, gentle introduct... by jsmith45 on Monday January 23, 2023 @12:27PM (#34491957)
All of the above.

NixOS is actually fairly well suited to a full desktop OS. They package-up basically everything you would expect. You can even pull in Steam its proton environment without much hassle.

It is also perfectly workable as simple server OS running on bare metal or a VM.

One can use it on other OSes as a way to create fully deterministic environments for developing. (Like the python virtualenv concept, but for any language, pulling any arbitary tools you might need). Almost like a docker container, but without isolating the filesystem.

Using just nix tool not as part of NixOS, can be an underwhelming experience, as the default does not quite give the fully declarative environment setup you might want. For example, under the default you can imperatively request packages to be added to the nix store. But if you chose to use the "correct" versions of commands, you can get the intended result. Alternatively, using it in conjunction with tools like direnv (which enables you to configure your shell to ask nix for a specific environment when you cd into it, or alternatively when you run a specific command within it). This environment can have exactly the set of tools you need for developing the project that lives in this folder, even if the rest of your OS has a different and incompatible version of the compilers installed, or whatever.

Re:Zero to Nix, an unofficial, opinionated, gentle introduct... by pxc on Monday January 23, 2023 @12:27PM (#34491954)
People use Nix on desktop a ton, but there GUI tools in the ecosystem are still largely marginal and incomplete. The screenshots here would just be images of text, which is probably why there aren't any.
Re:Zero to Nix, an unofficial, opinionated, gentle introduct... by turboponyy on Monday January 23, 2023 @12:13PM (#34491742)
Yes, all of the above - and much more.
Re:Zero to Nix, an unofficial, opinionated, gentle introduct... by whateveracct on Monday January 23, 2023 @12:11PM (#34491725)
Screenshots of what exactly? Installing packages? Running nixos-rebuild switch? I guess screenshots of a bunch of text.
Re:Zero to Nix, an unofficial, opinionated, gentle introduct... by lynndotpy on Monday January 23, 2023 @01:32PM (#34492948)
Yes! Assuming that is what "using Nix" looks like for an expected use case, that would be informative for someone who does not know what using Nix looks like.
Re:Zero to Nix, an unofficial, opinionated, gentle introduct... by whateveracct on Monday January 23, 2023 @06:05PM (#34496383)
You will like nixos.org then :)

https://nixos.org/

Lots of examples if you scroll down!

Re:Zero to Nix, an unofficial, opinionated, gentle introduct... by lynndotpy on Tuesday January 24, 2023 @12:00PM (#34506371)
Oh this is completely and exactly what I was thinking of, thank you! :)
Re:Zero to Nix, an unofficial, opinionated, gentle introduct... by choward on Monday January 23, 2023 @01:47PM (#34493143)
Been using it as my desktop for about 5 years and have never looked back.
Re:Zero to Nix, an unofficial, opinionated, gentle introduct... by tripdout on Monday January 23, 2023 @04:20PM (#34495242)
You can use 'Nix' itself for writing NixOS packages, creating Docker images, etc. For NixOS, it's perfectly valid as a desktop OS (I use it on my daily driver laptop) as well as on a server.
Re:Zero to Nix, an unofficial, opinionated, gentle introduct... by OmarAssadi on Monday January 23, 2023 @05:45PM (#34496198)
Nix is pretty usable for both desktops and headless servers. Personally, I even use it on macOS without much trouble.

My system looks like any other install of Ventura, but all of my configuration, ranging from the terminal and VS Code to macOS-specific system preferences and Safari, is done declaratively in Nix [1]. The overwhelming majority of my installed software also comes from Nix packages, with some exceptions for stuff that is not packaged yet (e.g., I have Podman Desktop, the macOS ZFS port, Lulu, yubikey-manager-qt installed through Homebrew -- fortunately nix-darwin [2] also just lets me have an set of brews/casks in my config).

It was been a bit of a nightmare at first since the error messages are kind of horrific, and there can be a lack of good examples/docs on flakes. But I think the weekend worth of time I invested was worth it since I no longer need to rely on hacky shellscripts or remember to manually configure anything.

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

[2]: <https://github.com/LnL7/nix-darwin>

Re:Zero to Nix, an unofficial, opinionated, gentle introduct... by pxc on Monday January 23, 2023 @06:25PM (#34496595)
Holy crap! I had no idea that Nix-Darwin will even install, configure, and wrap Homebrew for you now. That's awesome. Love the inclusive, impure approach.

The Homebrew module for Nix-Darwin also looks awesome, like extremely feature-complete.

Re:Zero to Nix, an unofficial, opinionated, gentle introduct... by JamesSwift on Monday January 23, 2023 @09:39PM (#34498430)
Interesting, so you are running both home-manager and nix-darwin? When I got into the game, it seemed like they were a bit of a one-or-the-other. I use home-manager but keep homebrew around for some cask management and its mostly "out of band" right now, so I'd be interested to move that "in band" if possible.