Howdy y’all non-developer trying to understand nix flakes.

  • hallettj@leminal.space
    link
    fedilink
    English
    arrow-up
    4
    ·
    12 days ago

    Docker Compose runs services, manages dependencies between services, isolates each service in a container, manages a private network. Out-of-the-box flakes don’t do any of that - except arguably running one service at a time. What flakes do is build software, which is the thing that Docker Compose doesn’t really do. (Or doesn’t do well.)

    I’d compare flakes to Makefiles with waaay more expressiveness and reproducibility. Or maybe a comparison could be to a Dockerfile, minus containerization, with waaay more expressiveness and reproducibility.

    There are tools you can add on to get Nix to do what Docker Compose does:

    Arion is a Nix frontend for Docker Compose. You’re still using Docker Compose, but it layers on the extra expressiveness and reproducibility of Nix flakes, or other kinds of Nix expressions.

    process compose flake is similar, but instead of Docker Compose it is a frontend for Process Compose. You get a similar result, but without containerization. That can potentially avoid the need to run in a VM on non-Linux systems that don’t natively support containers.