diff --git a/doc/examples.md b/doc/examples.md index ea8abf22..bf856746 100644 --- a/doc/examples.md +++ b/doc/examples.md @@ -2,3 +2,5 @@ - [[share-services]]# - [[llm]]# +- [[without-flake-parts]]# + diff --git a/doc/without-flake-parts.md b/doc/without-flake-parts.md new file mode 100644 index 00000000..6415beb3 --- /dev/null +++ b/doc/without-flake-parts.md @@ -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 . + diff --git a/example/without-flake-parts/flake.lock b/example/without-flake-parts/flake.lock new file mode 100644 index 00000000..645f72c6 --- /dev/null +++ b/example/without-flake-parts/flake.lock @@ -0,0 +1,59 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1729265718, + "narHash": "sha256-4HQI+6LsO3kpWTYuVGIzhJs1cetFcwT7quWCk/6rqeo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ccc0c2126893dd20963580b6478d1a10a4512185", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "process-compose-flake": { + "locked": { + "lastModified": 1729533882, + "narHash": "sha256-wWho1T8byOa+anblfMmg1Rig6VOXYkrZuM1ESuAx4W0=", + "owner": "Platonic-Systems", + "repo": "process-compose-flake", + "rev": "644a8a129f17d23df9e6cf58c9bb1097a0959ab1", + "type": "github" + }, + "original": { + "owner": "Platonic-Systems", + "repo": "process-compose-flake", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "process-compose-flake": "process-compose-flake", + "services-flake": "services-flake" + } + }, + "services-flake": { + "locked": { + "lastModified": 1729432400, + "narHash": "sha256-tf6kIAa3jgGi/2ifRGHNCb+vq/QmuS0bJBpqhRBRd9A=", + "owner": "juspay", + "repo": "services-flake", + "rev": "fdc39a6e05b2d8abd09a61e9757349a0f5b0a1a0", + "type": "github" + }, + "original": { + "owner": "juspay", + "repo": "services-flake", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/example/without-flake-parts/flake.nix b/example/without-flake-parts/flake.nix new file mode 100644 index 00000000..15012dad --- /dev/null +++ b/example/without-flake-parts/flake.nix @@ -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; + } + ]; + }; + } + )); + }; +} diff --git a/flake.nix b/flake.nix index 59a62f30..dec639fb 100644 --- a/flake.nix +++ b/flake.nix @@ -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";