Is it possible to start a service in nix-shell

I work under NixOS and I really like it.

For my coding projects, I am trying to reach separate development environments. So, for example, for my Scala / node.js project, I wrote default.nix for nix-shell:

with import <nixpkgs> {}; { tarifs2Env = stdenv.mkDerivation { name = "webapp"; buildInputs = with pkgs; [ sbt nodejs nodePackages.gulp ]; shellHook = '' ''; }; } 

So far so good. Now I would like to add a database, for example posgtres. Is there a way to add a service to nix-shell?

+5
source share
1 answer

I think https://github.com/chrisfarms/nixos-shell should do exactly what you need. I did not use it myself, but as I understand it, it takes the .nix configuration, which describes the services (s) you want, then creates the configuration in the NixOS ephemeral container and throws you into a shell in the container.

+3
source

All Articles