I've used docker-compose, k8s, and NixOS myself, being from a similar technical background as the author, but I find myself disagreeing with some of the author's opinions on the technologies. They're not wrong of course, but I've had different experiences. k8s: Installing and using k8s can indeed be a nightmare. In my job, we use Azure, so it's not so bad since launching a cluster is mostly handled by Azure. Setting…
Deploying Containers on NixOS: A Guide
31–40 of 60 posts
Re: Deploying Containers on NixOS: A Guide
#32I've used docker-compose, k8s, and NixOS myself, being from a similar technical background as the author, but I find myself disagreeing with some of the author's opinions on the technologies. They're not wrong of course, but I've had different experiences. k8s: Installing and using k8s can indeed be a nightmare. In my job, we use Azure, so it's not so bad since launching a cluster is mostly handled by Azure. Setting…
Re: Deploying Containers on NixOS: A Guide
#33Could someone please help me understand the benefit of Nix versus just using docker-compose? Also please don't tell me k8s it. Way too heavy. I run a few applications on a souped-up Raspi (paperless-ngx, jellyfin, some postgres dbs). I can't see why this would improve things. :) Honest question.
From my experience, 1. There are many services that is already "implemented" in NixOS, with sane default configurations and easy to customize (because the contributors have designed good abstractions, and also because of the flexibility of Nix language). One good example is `nginx`. Btw `paperless-ngx` and `jellyfin` are also already implemented. In this case you do not need to use docker at all. 2. Because of the go…
What entity is responsible for the security of those combinations of default settings? And how are security updates handled?
Re: Deploying Containers on NixOS: A Guide
#34Earlier quoted context omitted.
Troubleshooting Nix is mind-numbing. For some of the benefits, it's the price that is need to be paid
It doesn't need to be paid though, it's just a result of poor design and poor documentation. It's the only OS where I feel like I'm both 20 years in the future and 20 years in the past.
Re: Deploying Containers on NixOS: A Guide
#35Earlier quoted context omitted.
Thanks for the perspective. I mainly use NixOS to run my server's not personal machines. I can see why it can be a frustrating experience for a machine that you just want to run personal stuff on. In my instance of creating server machines(cattle), the configurations are pretty light and what's important is the reproducibility aspect of it. If I need to take one down and rebuild another it takes about 10 minutes. All…
I'm a big nixos fan myself, and I appreciate your post, I don't do any of the socials listed on your site and noticed the word 'serice' if you wanted some backseat editor. Apologies if hn comment in the wrong place for the feedback.
Re: Deploying Containers on NixOS: A Guide
#36I've used docker-compose, k8s, and NixOS myself, being from a similar technical background as the author, but I find myself disagreeing with some of the author's opinions on the technologies. They're not wrong of course, but I've had different experiences. k8s: Installing and using k8s can indeed be a nightmare. In my job, we use Azure, so it's not so bad since launching a cluster is mostly handled by Azure. Setting…
> As a random example, I googled "packaging python for nix" and the top result [1] is just way too complex for something that should be pretty simple. Aware that this is more of a critique about the documentation situation, as opposed to the python packaging situation. However, there is poetry2nix[1]. Which makes packaging look something like this: myPythonApp = mkPoetryApplication { projectDir = ./.; }; [1]( https:/…
So we're now getting yet another attempt, this time called pyproject-nix[3].
I'm now considering taking similar stab with common lisp packaging, because the amount of time I lost fighting Nix trying to run a development environment is making me reconsider using Nix at all.
[1] https://github.com/nix-community/poetry2nix#:~:text=announce...
[2] https://pyproject-nix.github.io/pyproject.nix/build.html
Re: Deploying Containers on NixOS: A Guide
#37NixOS OCI containers are a powerful way to run apps that are not packaged for Nix or NixOS. And because they’re ultimately systemd units, you can customize virtually everything without having to fiddle with the container runtime. If you want to take this a step further and migrate or run a Compose project on NixOS, I maintain a tool that makes this pretty easy to do :) https://github.com/aksiksi/compose2nix
Re: Deploying Containers on NixOS: A Guide
#38Earlier quoted context omitted.
Troubleshooting Nix is mind-numbing. For some of the benefits, it's the price that is need to be paid
It doesn't need to be paid though, it's just a result of poor design and poor documentation. It's the only OS where I feel like I'm both 20 years in the future and 20 years in the past.
- Are we packaging just one Python package for Nix, or a thing and all its dependencies?
- Is the package already on PyPI, and are we packaging the source from there, or is it the source from some upstream?
- Are any of the dependencies coming from source, either their upstreams or forks?
- For dependencies that already exist in the nixpkgs SHA that is supplying the Python interpreter, do we want to use those versions, or package newer versions? Is it the same decision for everything, or does it vary?
- Is there already a Python level dependency locking scheme in place such as poetry/pipenv/uv, or is it a plain setuptools package? Is it acceptable for Nix to become the locking mechanism, or will that mess things up for non-Nix consumers of this?
- Are we looking to supply a development environment here too, or is this purely about deployment?
To be clear, none of this is an excuse— it's horrifying that there can't be a single "Tool X is the singular Python-on-Nix story, follow the one page tutorial and you're all set". But I think the massive amount of choice and flexibility is the crux of why new methods and tools are still being rapidly invented and proposed.
For myself, I would choose poetry2nix as how I'd ship a Python project to Nix hosts, but that immediately implies some answers to a bunch of the above questions, mandates poetry for your top level project, and once you look closer there turn out to be some truly horrifying implementation details [1] that are what make poetry2nix appear as seamless and friendly as it does.
[1]: https://github.com/nix-community/poetry2nix/blob/master/over...
Re: Deploying Containers on NixOS: A Guide
#39NixOS OCI containers are a powerful way to run apps that are not packaged for Nix or NixOS. And because they’re ultimately systemd units, you can customize virtually everything without having to fiddle with the container runtime. If you want to take this a step further and migrate or run a Compose project on NixOS, I maintain a tool that makes this pretty easy to do :) https://github.com/aksiksi/compose2nix
Thanks for the link, I've got a bunch of hacky code for running Immich's compose under Nix that this might be able to replace.