Re:Creating bundles with guix pack
by chriswarbo on Tuesday March 21, 2017 @06:08PM
(#13926734)
> In fact, it's probably quite straightforward to implement a docker-like system as a bunch of Nix functions
Oh, it turns out that already exists. Just came across some tests, which appear to chroot into another OS image and run commands. Complete coincidence :)
It's probably possible, if you're running Nix on a Debian-based distro, assuming permissions and things are set up right. Of course, that probably counts as Nix abuse, the results wouldn't be any nicer than using apt-get as-is, and it may play badly with Nix's caching.
As a more realistic example, it's perfectly possible to fetch a bunch of repos and configure/build them using the normal processes for that language, e.g. something like this for a Haskell package:
If you like opaque, monolithic blobs of bash, then the above seems pretty comparable to Docker. The reason few Nix users would do such a thing isn't that it's not possible, it's just that Nix's language makes it easy to decouple those pieces into composable modules; verify, cache and share intermediate results; selectively override parameters; inspect and debug at a REPL; etc.In fact, it's probably quite straightforward to implement a docker-like system as a bunch of Nix functions, e.g. to get something like: