Skip to content

Commit

Permalink
chore(example/without-flake-parts): init (#372)
Browse files Browse the repository at this point in the history
A useful addition that demonstrates more ways to use `services-flake`
  • Loading branch information
shivaraj-bh authored Oct 21, 2024
1 parent fdc39a6 commit 99ba371
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

- [[share-services]]#
- [[llm]]#
- [[without-flake-parts]]#

6 changes: 6 additions & 0 deletions doc/without-flake-parts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Services for flakes without flake-parts

`process-compose-flake` provides the [`makeProcessCompose`](https://github.com/Platonic-Systems/process-compose-flake/blob/644a8a129f17d23df9e6cf58c9bb1097a0959ab1/nix/lib.nix#L48-L53) function, which accepts custom configurations and returns the [process-compose](https://github.com/F1bonacc1/process-compose) package.

For usage, refer to <https://github.com/juspay/services-flake/tree/main/example/without-flake-parts>.

59 changes: 59 additions & 0 deletions example/without-flake-parts/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions example/without-flake-parts/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
description = "A demo of services-flake usage without flake-parts";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
process-compose-flake.url = "github:Platonic-Systems/process-compose-flake";
services-flake.url = "github:juspay/services-flake";
};
outputs = inputs:
let
supportedSystems = [ "x86_64-linux" "aarch64-darwin" ];
forAllSystems = inputs.nixpkgs.lib.genAttrs supportedSystems;
in
{
packages = forAllSystems (system: (
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
in
{
redis = (import inputs.process-compose-flake.lib { inherit pkgs; }).makeProcessCompose {
modules = [
inputs.services-flake.processComposeModules.default
{
services.redis."r1".enable = true;
}
];
};
}
));
};
}
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
};
dir = "./example/share-services/pgweb";
};
without-flake-parts-example = {
inherit overrideInputs;
dir = "./example/without-flake-parts";
};
test = {
inherit overrideInputs;
dir = "./test";
Expand Down

0 comments on commit 99ba371

Please sign in to comment.