4 ms·
Nowadays, every one of my projects starts with a flake.nix file. I even have templates (https://peppe.rs/posts/novice_nix:_flake_templates/ https://peppe.rs/pos
by smasher164 4y ago
Nowadays, every one of my projects starts with a flake.nix file. I even have templates (https://peppe.rs/posts/novice_nix:_flake_templates/ https://peppe.rs/posts/novice_nix:_flake_templates/) fo archetypes of projects, like a Go, Rust, GTK project, etc...
I love that flakes allow you to decouple a package from nixpkgs and place it in your repo, but in order to fully realize this dream, there needs to be a proper index of these packages, as well as non-experimental support for flakes.
Another (pipe) dream of mine is that Nix gets true cross-platform support, including non-WSL windows. This would allow it to fulfill a role that doesn't currently exist, which is a cross-platform package manager and build system that works across language ecosystems.
- woile 4y agoThat sounds interesting. I have 0 experience with nix, could you explain what's the difference with doing `cargo new <name>`? What extra benefits do you get? Thanks!
- the_gipsy 4y agoThat gets you some Cargo.toml/lock files, from which you can build on another system. But there are some system dependencies, like dynamic libraries, which are not described nor pinned. Nix forces you to describe 100% of the build/run inputs.
- rgoulter 4y agoAh, in terms of just instantiating a template, the nix flake templates are going to be oriented around using nix. A flake.nix file is roughly comparable to a Dockerfile. With a Dockerfile, you're describing how to build an image that can be deployed in Docker runtimes. With nix, you're describing how nix can build the package. A neat side-effect of this is that if you've got a nix file which can build the package, nix will be able to provide the toolchain used to build the package. (Whereas rustup more specifically provides the rust toolchain).
- dfee 4y agoI’m not sure what it is, but you’ve got some odd font-size bugs going on.
- smasher164 4y agoOh that page isn't mine, I just found it as a good explainer for nix templates.