Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'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/mo... (they're also listed at 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-... but that seems a bit more advanced.



I appreciate the time you put into this response, thanks! I’ll give it a go




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: