Nix and NixOS have had a similar sort of effect on me as Gentoo and FreeBSD have in the past. They have helped to expand my consciousness in the realm of systems administration and have helped me achieve new heights with my low latency audio configuration. For this reason, Nix and NixOS have become indispensable to my workflow. NixOS introduces a new form of declarative configuration, fusing Gentoo's highly configura…
Zero to Nix, an unofficial, opinionated, gentle introduction to Nix
11–20 of 227 posts
Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix
#12The same Zero to NixOS would be highly appreciate.
Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix
#13> Zero to Nix is opinionated because it advocates learning and using flakes and treating channels as deprecated. I think I need a “Channels to Flakes”. I have an existing system configuration that seems to work fine without flakes. What am I missing out on?
Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix
#14I am glad someone is doing this. There's lots of things in nix I want to try and use but the tooling and docs are just a bridge too far for me, if someone's going to give the initial ux a do over then I'm down for that!
Thanks, Jorge! I think the nix3 interface and the Flakes solve a lot of UX problems. Maybe we could do a bit of a user study, to see where you get hung up?
Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix
#15Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix
#16I am glad someone is doing this. There's lots of things in nix I want to try and use but the tooling and docs are just a bridge too far for me, if someone's going to give the initial ux a do over then I'm down for that!
Thanks, Jorge! I think the nix3 interface and the Flakes solve a lot of UX problems. Maybe we could do a bit of a user study, to see where you get hung up?
Though i still have no clue how to update to 3.0 if i wanted to. Searching for `nix` is incredibly obtuse given the language is Nix and the OS is Nix. (I know i know, Nix, NixOS, Nixpkgs, but you know what i mean)
Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix
#17I read of Nix now and then. Seems its more than a fad. Why should I invest time? What makes it stand out?
Potentially it can save you time in the future. Moving to another hardware is a breath.
Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix
#18I read of Nix now and then. Seems its more than a fad. Why should I invest time? What makes it stand out?
For some people this is good because future shock has made relying on system libaries to run things very troublesome. So troublesome it compares to the above.
Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix
#19I read of Nix now and then. Seems its more than a fad. Why should I invest time? What makes it stand out?
You can use derivations as (/ to represent) - packages - generated configuration files / settings - containers - whole OS images ... e.g. I'm building raspi SD card images using Nix.
Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix
#20I read of Nix now and then. Seems its more than a fad. Why should I invest time? What makes it stand out?
It's not for everyone.
Specifically, because Nix's 'costs' are upfront (for likely future benefit), nix isn't well suited to just-get-it-done pragmatic attitudes. -- e.g. if you'd prefer to just launch VMs from the web console, over using a tool like Terraform, then Nix isn't going to be for you.
Nix isn't too difficult to use. I'd say it's 95% wonderful, 5% huge pain to deal with. (Writing new nix code can be very hard).
As to why it's worth learning:
> What makes it stand out?
Nix provides very expressive control over packages of software.
e.g. With nix, it's easy to have multiple versions of the same software running on the same system. Whereas, with package managers, if you upgrade, you aren't able to easily also keep the old version around.
Some of the use cases Nix allows are pretty neat:
- You can declare a set of development tools to be made available. So, when you load up the project, you don't have to copy-paste "apt-get install...". This is especially useful for side projects you might not touch all the time.
- There's a "nix run" command, which can act a bit like "docker, without containers": it will download the package, and run it on the host.
- NixOS makes use of Nix so that the system configuration is all declared starting from a single file. Rolling back changes to system configuration is easy, in case you accidentally misconfigure the system. -- This can be used to build container images or VM images.
- Nix can be used to declare what packages you want installed for your user, and declare the configurations for these files. This allows ensuring you have a familiar setup quickly on a new computer.
All sorts of programming involves dealing with packages.
To clarify a bit on the details: nix declares packages in a pure way, using all of its inputs (source code, compiler, library dependencies; which are themselves declared with nix), and builds these in an isolated/non-global directories. Packages are 'installed' by symlinking to where the package is placed.