Live data from Hacker News

Nix journey part 0: Learning and reference materials

tinkering.xyz

1–10 of 79 posts

Re: Nix journey part 0: Learning and reference materials

#2
My current objective is to make an easy and reproducible configuration + live image installer. I want to automate the whole process. As soon as I plug in the USB stick, my preferred defaults should do their work without user input.

Although, I really don't like Nix as a language. I really wish it would have used something like GNU Guile. Searching deep for nuggets of information isn't nearly as painful as the language itself. I might adapt to it in time, but still.

Re: Nix journey part 0: Learning and reference materials

#4

Author here if anyone has questions

Any good resources on how to use flakes? I'm currently experimenting with having home-manager work via a flake but I haven't come across any good HOWTOs on common operations. For example, I'd like to update the flake dependencies similar to how I used to use "nix-channel --update" to freshen the dependencies used by home-manager.

Re: Nix journey part 0: Learning and reference materials

#5
post #4

Author here if anyone has questions

Any good resources on how to use flakes? I'm currently experimenting with having home-manager work via a flake but I haven't come across any good HOWTOs on common operations. For example, I'd like to update the flake dependencies similar to how I used to use "nix-channel --update" to freshen the dependencies used by home-manager.

"nix flake update" should be able to do that.

Re: Nix journey part 0: Learning and reference materials

#7

My current objective is to make an easy and reproducible configuration + live image installer. I want to automate the whole process. As soon as I plug in the USB stick, my preferred defaults should do their work without user input. Although, I really don't like Nix as a language. I really wish it would have used something like GNU Guile. Searching deep for nuggets of information isn't nearly as painful as the languag…

Not for sure if you are working on SD card based things but this might get you half way there. We do this for loading RPIs https://github.com/Robertof/nixos-docker-sd-image-builder

Re: Nix journey part 0: Learning and reference materials

#8

So, I don't quite grok nix. Am I supposed to use it instead of Ansible and Terraform? Where does it fit exactly?

Without having properly tried it either, my general impression is that the pitch goes a bit like this:

If you love Haskell and wants to make everything that has to so with packages on your system more like Haskell, Nix's got your back.

Re: Nix journey part 0: Learning and reference materials

#9

So, I don't quite grok nix. Am I supposed to use it instead of Ansible and Terraform? Where does it fit exactly?

It is a powerful abstraction that ends up being a replacement for several kinds of tools depending on your use case.

It can be a way to declaratively configure a system similar to ansible.

It can be a way to isolate runtimes (e.g. ruby v2.8 and ruby v3.0) in different projects similar to rbenv / virtualenv.

It can be a way to define an application in a self-contained way so that the target platform needn't have needed software installed beforehand similar to docker.

It can be a way to install packages/software to your system in a well-defined way similar to many package managers.

Re: Nix journey part 0: Learning and reference materials

#10
post #4

Author here if anyone has questions

Any good resources on how to use flakes? I'm currently experimenting with having home-manager work via a flake but I haven't come across any good HOWTOs on common operations. For example, I'd like to update the flake dependencies similar to how I used to use "nix-channel --update" to freshen the dependencies used by home-manager.

This is a script I run every monday when I come into work to get the latest updates on my system [1]. It prints the flake hash when it runs, so I can also rollback if there are issues.

[1] - https://gist.github.com/J-Swift/a4dad59843f1a1f512a72308031b...

Post reply on HN