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 journey part 0: Learning and reference materials
21–30 of 79 posts
Re: Nix journey part 0: Learning and reference materials
#22Re: Nix journey part 0: Learning and reference materials
#23Re: Nix journey part 0: Learning and reference materials
#24So, I don't quite grok nix. Am I supposed to use it instead of Ansible and Terraform? Where does it fit exactly?
It is possible to “hash” a function so that the hash stays the same for as long as the function does the same thing (in which sense the language is similar to, e.g., Dhall), which is guaranteed because 1) function is pure, 2) the hash derives also from any other functions it may call and all the way down, and 3) everything is a function.
In the world of package management that gives you a superpower and/or curse of being able to say “I want dependency X” and mean “I want a dependency built in this exact way”. When applied thoroughly, the only inconsistencies in behavior that can arise in theory would be due to logic errors in external to Nix software or to hardware issues[0].
From provisioning deployed software runtime environments (in which sense Nix is more similar to, e.g., Docker) to automating your development machine configuration—basically anywhere you want consistency and hate surprises—in this sense Nix suffers from solving very different problems for different people, and as a result people being confused as to what is it for just by looking at articles and discussion threads about it.
[0] In practice, you might occasionally have to fight poorly behaved software that makes unwarranted assumptions about the system (can’t be installed into or look for dependencies under hash-paths), modifies itself (auto updates), etc.
Re: Nix journey part 0: Learning and reference materials
#25Re: Nix journey part 0: Learning and reference materials
#26The nix package search website is OK, but it doesn't let you filter by the names of installed binaries. A lot of the time, you have a question like "what nixpkgs attribute do i install in order to get the `python3` command". I recently wrote a command line tool that allows you to do this. It uses the same elasticsearch index as the search website, but allows more powerful filtering. If anyone is thinking of getting i…
Re: Nix journey part 0: Learning and reference materials
#27Earlier quoted context omitted.
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.
Here you go: https://nixos.wiki/wiki/Flakes https://tonyfinn.com/blog/nix-from-first-principles-flake-ed... The second link appears to be down at the moment so check back later.
Re: Nix journey part 0: Learning and reference materials
#28The nix package search website is OK, but it doesn't let you filter by the names of installed binaries. A lot of the time, you have a question like "what nixpkgs attribute do i install in order to get the `python3` command". I recently wrote a command line tool that allows you to do this. It uses the same elasticsearch index as the search website, but allows more powerful filtering. If anyone is thinking of getting i…
I have had to look directly in the /nix/store enough times that I lost count.
Re: Nix journey part 0: Learning and reference materials
#29My 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…
Can you clarify what parts you don't like. I think it's important to distinguish so I know what portions to work on (and figure out how to fix it). Is it: the language syntax itself, the idioms used in Nixpkgs, the module system, the common frameworks used to create package sets, or something else?
There is very poor ability to reason about the 'types'/shapes of arguments or the semantics of what outputs should conform to.
It seems to require either 1) deep knowledge about the orchestration of the evaluation of the key files you interact with (e.g., what the inputs to configuration.nix will be) or 2) reading many, many examples which eventually have the hints you want.
Re: Nix journey part 0: Learning and reference materials
#30Earlier quoted context omitted.
Can you clarify what parts you don't like. I think it's important to distinguish so I know what portions to work on (and figure out how to fix it). Is it: the language syntax itself, the idioms used in Nixpkgs, the module system, the common frameworks used to create package sets, or something else?
The language is in a weird place. The language itself is okay, but you're often trying to use the language to compute a result that meets an interface that is never defined. There is very poor ability to reason about the 'types'/shapes of arguments or the semantics of what outputs should conform to. It seems to require either 1) deep knowledge about the orchestration of the evaluation of the key files you interact wi…
I haven't done any packaging or gotten into flakes as a unit of composable configuration. I know flakes are intended to make these things easier, but even the 'specification' for what makes a valid flake seems awfully vague.