Resources for nix, the package manager
https://nix-community.github.io/awesome-nix/
- https://learnxinyminutes.com/docs/nix/
- https://nixos.org/manual/nix/stable/#ch-expression-language
- https://nixos.wiki/wiki/Nix_Expression_Language
- https://nixos.wiki/wiki/Flakes
- excellent: https://serokell.io/blog/practical-nix-flakes
- https://github.com/colemickens/nixos-flake-example
- https://hoverbear.org/blog/a-flake-for-your-crate/
- https://zimbatm.com/notes/nixflakes
- (perhaps outdated) https://gist.github.com/edolstra/40da6e3a4d4ee8fd019395365e0772e7
- https://blog.ysndr.de/posts/internals/2021-01-01-flake-ification/#creating-a-flake-for-this-blog
Overlays
Cross-compilation
- https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.section.md#cross-compilation-cross-compilation
- https://github.com/oxalica/rust-overlay/blob/master/docs/cross_compilation.md
Building for Workspaces
- https://discourse.nixos.org/t/using-buildrustcrate-to-build-a-project-within-a-cargo-workspace/15672
- https://github.com/efx/nix-flake-cargo-workspace
Tutorials
- https://www.srid.ca/rust-nix
- https://hadean.com/managing-rust-dependencies-with-nix-part-i/
- https://github.com/Twey/mkRustCrate/
Cargo subcommands
- Useful issue for
devShell
(withflakes
): oxalica/rust-overlay#30 - https://github.com/kamadorueda/alejandra/blob/main/flake.nix
- https://github.com/enarx/enarx/blob/main/flake.nix
- https://github.com/Holo-Host/holo-nixpkgs
For cross-compilation (e.g. custom target) see https://github.com/oxalica/rust-overlay/blob/master/docs/cross_compilation.md.
- Nix Manual: Verifying Build Reproducibility
Note that config values (e.g. in /etc/nix/nix.conf
) can be passed to nix-build
as in
nix-build --option sandbox true --option enforce-determinism true --option repeat 3
- Is NixOS Reproducible? -- See last section "How can I test my patches?" about the trick of using
nix-build --check
- Reproducible Builds: Nix vs Docker
- On using Nix and Docker as deployment automation solutions: similarities and differences
- Could
flakes
help? https://discourse.nixos.org/t/to-flake-or-not-to-flake/10047/4 - Will Nix overtake Docker?
- https://news.ycombinator.com/item?id=29387137
- https://news.ycombinator.com/item?id=24981633
- https://serokell.io/blog/what-is-nix
- https://plurrrr.com/archive/2021/11/30.html
- https://chameth.com/reproducible-builds-docker-images/
- https://www.reddit.com/r/docker/comments/exb93x/how_to_create_reproducible_docker_builds/
- https://github.com/Jille/dockpin
- https://users.rust-lang.org/t/testing-out-reproducible-builds/9758
- rust-lang/rust#34902
- CosmWasm/wasmvm#136
- https://www.reddit.com/r/rust/comments/jct0y4/when_reproducible_builds/
- (C, C++, rust) https://nikhilism.com/post/2020/windows-deterministic-builds/
Reproducible Builds: Increasing the Integrity of Software Supply Chains 1-2-3 Reproducibility for Quantum Software Experiments