-
|
TL;DR: Is it always necessary to Firstly, thank you! My stack is Postgres, Redis and Nats, so it looks like I'm well covered straight out of the box. I'm right at the beginning of my journey with The flake gets loaded by Here's my flake so far: {
description = "Testing services-flake with Redis";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# services-flake
process-compose-flake.url = "github:Platonic-Systems/process-compose-flake";
services-flake.url = "github:juspay/services-flake";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
# import the flake module
inputs.process-compose-flake.flakeModule
];
systems = inputs.nixpkgs.lib.systems.flakeExposed;
perSystem = { pkgs, config, ... }: {
# Create the process-compose configuration, importing services-flake
process-compose."default" = {
imports = [
inputs.services-flake.processComposeModules.default
];
# Define the services to be started
services = {
redis."r1".enable = true;
};
};
# DevShell
devShells.default = pkgs.mkShell {
inputsFrom = [
config.process-compose."default".services.outputs.devShell
];
};
};
};
}When I Obviously |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
I'm going to close this. I've only just found out the Every day is a school day! |
Beta Was this translation helpful? Give feedback.
-
|
Having services up automatically when you are in the Also, DX can be much nicer if you combine that with services listening on unix domain sockets instead of TCP. This eliminates the global state (of binding to the port). See an example of this in https://github.com/juspay/todo-app/blob/master/nix/services/default.nix. |
Beta Was this translation helpful? Give feedback.
-
|
Unrelated, but since there is a mention of background services, #354 will allow one to import Aside: solving #354 will make it easier to support more backends in the future. |
Beta Was this translation helpful? Give feedback.
I'm going to close this. I've only just found out the
direnvmakesnix developredundant as I'm already in a "dev shell"! Sonix runis the way to manually start Process Compose!!Every day is a school day!