-
I already use Nix to manage my software dependencies, create development environments, build my software, and create OCI containers. After listening to Solomon speak on the Changelog podcast, I am not sure how or if Dagger could fit into my workflow. My CI/CD pipelines are currently in GitHub Actions and GitLab CI. All they do is say "use this image and run that test". All the software is already prebuilt etc. in the container. How can Dagger improve this? Will it play nicely with Nix, or not? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
👋 @nat-418 To answer your first question: would non-Nix users be able to run your workflows the same way you do without installing Nix? In my experience, Nix on Mac would stop working after every reboot. I tried various suggestions & stuck with it for several months in late 2021, but in the end I went back to As for your second question, Dagger works on NixOS (and with Nix) similar to how Docker does. While there is no Dagger Nix SDK, it wouldn't be too difficult to implement it. We actually spoke with @tazjin about this idea some months after https://changelog.com/shipit/37 & a few months before our other SDKs came out:
While my Nix on Mac experience was not great, I have been running a dedicated NixOS host since 2023.03. It's been a mostly positive experience, and while I still didn't get past the Nix learning curve, I am running all my homelab stuff on that host (including Dagger Engine, Docker, Grafana, Prometheus, etc.). I am curious to experience Pop OS next, on the same hardware. FWIW, my other bare metal Linux host is Talos OS. And while I get @mitchellh's passion & mastery of Nix - https://mitchellh.com/writing/nix-with-dockerfiles - and I suspect that you share some of that too, most of the people that I speak to just want to use their programming language + preferred code editor for CI/CD. I see Dagger as a good choice for everyone that doesn't want to learn another DSL, and/or wants to keep YAML at a minimum. Do you have some GitHub workflows to share @nat-418? What about some Nix code? I am curious to see what that looks like in practice. cc @vito. There is some cool Nix here: https://github.com/vito/bass |
Beta Was this translation helpful? Give feedback.
-
It's true that right now Dagger is mostly used as a build + test tool, so if you've already bought into Nix it probably seems a bit redundant, since that's also Nix's bread + butter. I could ramble about this for ages, but I think the tl;dr is that Nix is mostly focused on building things, while Dagger is interested in a more generic approach that can be applied to every stage of the app development lifecycle:
Nix covers a lot of this, but it comes with some strong opinions and a steep learning curve. Dagger is essentially a specialized tool for running cached, lazily-evaluated containers and content-addressed services. It blurs the line between build + run, so you just think about code most of the time, and what you can do with it. As an example of things you can do with this specialized tool, you can implement Docker Compose in 199 lines of Go. I could probably implement a decent CI system, or re-implement Concourse. Lots of people could, in their preferred language. As for how they relate to one another: beneath all of this, ideally you are using a reproducible toolchain. Dagger encourages reproducible builds and has APIs built expressly to support it (WithTimestamps), but it doesn't enforce it. In my experience a lot of that comes down to tackling the base container image, which Nix is great at building. But I also have the option of using something like Wolfi or just YOLOing Anyway, that's all my 2c; I'm a big fan of Nix and use it as my daily OS. 😄 |
Beta Was this translation helpful? Give feedback.
It's true that right now Dagger is mostly used as a build + test tool, so if you've already bought into Nix it probably seems a bit redundant, since that's also Nix's bread + butter.
I could ramble about this for ages, but I think the tl;dr is that Nix is mostly focused on building things, while Dagger is interested in a more generic approach that can be applied to every stage of the app development lifecycle: