3 ms·
> we had to depend on DevOps for things I could whip up in Docker and bash in minutes I absolutely believe you (Nix has a bit of a learning curve), but just as
by chriswarbo 5y ago
> we had to depend on DevOps for things I could whip up in Docker and bash in minutes
I absolutely believe you (Nix has a bit of a learning curve), but just as a counterpoint I'd like to mention that I've been using Nix with all sorts of languages (compiled and interpreted), for various projects (local applications, cloud services, static HTML sites, etc.), on Ubuntu, NixOS and macOS.
I recently had to interact with Docker for the first time and found it very bizzare (annoyingly, lots of documentation (e.g. that of AWS ECS) assumes its readers are already familiar with Docker!). It took many attempts to install it, using various different guides, versions, etc., many of which turned out to be obsolete (e.g. "docker machine" was recommended, but that's apparently replaced by "docker desktop", but now I'm hearing I should use "docker compose"?).
After I eventually figured out how Docker works, I ditched it completely since I found it easier and more reliable to build container images using Nix and run them directly.
- exdsq 5y agoI'll give Nix another go, but I find it hard to just start scrapping things together. For example how would I create a dev environment for a simple Node app, managing Yarn dependencies and connections with a postgresql db? These are the sorts of things I'd love tutorials on doing
- chriswarbo 5y agoI'm not a heavy Node user, but I do have a project which happens to use Yarn. Not sure if it's the best approach, but this is how I'm creating the node_modules folder: nixpkgs.yarn2nix-moretea.mkYarnModules { name = "my-project-deps"; pname = "my-project-deps"; version = "1.0"; packageJSON = ../package.json; yarnLock = ../yarn.lock; } I copy things around, invoke commands, etc. using `nixpkgs.runCommand`, which runs shell code (a lot like rules in Make). I'm not sure about postgresql, since I've not used it before: - You could use Nix to install the packages, and manage it yourself. That wouldn't be particularly different from non-Nix setups. - You could install it on NixOS by specifying these options in your config https://github.com/NixOS/nixpkgs/blob/release-21.05/nixos/modules/services/databases/postgresql.nix#L41 https://github.com/NixOS/nixpkgs/blob/release-21.05/nixos/mo... (they're also listed at https://nixos.org/manual/nixos/stable/options https://nixos.org/manual/nixos/stable/options but that page is slow). Of course, that requires NixOS (or a VM). - You could run it in a container/VM, e.g. like https://nix.dev/tutorials/integration-testing-using-virtual-machines https://nix.dev/tutorials/integration-testing-using-virtual-... but that seems a bit more advanced.
- exdsq 5y agoI appreciate the time you put into this response, thanks! I’ll give it a go