Our great sponsors
-
nixery
Container registry which transparently builds images using the Nix package manager. Canonical repository is https://cs.tvl.fyi/depot/-/tree/tools/nixery
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
Moby
The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
That's correct. I recently ended up using `buildLayerImage` (actually `buildLayerImageWithNixDb` for CI, not only to run a single process, but also `systemd` and multiple processes. `podman` comes with built-in support for `systemd`.
[Here](https://github.com/fdb-rs/fdb/blob/fdb-0.2.2/nix/ci/flake.ni...) is relevant code.
samueldr has been doing a lot of work in that direction. See https://mobile.nixos.org/
With https://github.com/nlewo/nix2container, I'm trying to make a more standalone tool. Basically, a Go binary takes a reference graph and produces a JSON file describing a container image. This JSON file is then ingested by a Skopeo fork (it adds a new `transport`) to produce images (to file, registries,...).
Currently, it supports the dockerTools layering algorithm and is designed to work with Guix [1] as well;)
[1] https://github.com/nlewo/nix2container/blob/065e5b108650ee4c...
Yes, you will have to package it if it's not already in nixpkgs.
The good news is once you learn how, it's basically trivial with crate2nix[0], which can autogenerate nix derivations from rust crates
[0] https://github.com/kolloch/crate2nix
You can also use naersk¹ if you want to avoid a two-step process. It's especially convenient when using nix flakes.
¹https://github.com/nix-community/naersk
Thanks for clarify your point.
> If you have two layers installing an individual packages like /nix/store/x and /nix/store/y, stacking them as [x, y] and [y, x] would result in the same docker image contents
This is an assumption which is valid for nix, but not for most of the package managers. Whenever such assumption can be considered correct, Dockerfiles can achieve similar results using multiple stages, but you would probably need a pre-processor to have a stage for each package. Something like an `INCLUDE` directive could help too: https://github.com/moby/moby/issues/3378.
Just noting, using Nix it is possible to build an actual real deal Android image using Robotnix:
- https://github.com/danielfullmer/robotnix/
This is different from a non-Android Linux on Mobile devices, which is what Mobile NixOS aims to achieve :).