diff --git a/src/nix/lib.nix b/src/nix/lib.nix new file mode 100644 index 0000000..1e3ede6 --- /dev/null +++ b/src/nix/lib.nix @@ -0,0 +1,16 @@ +{ lib }: +let + + link = url: text: + ''link:${url}[${text}]''; + + dockerComposeRef = fragment: + ''See ${link "https://docs.docker.com/compose/compose-file/#${fragment}" "Docker Compose#${fragment}"}''; + +in +{ + inherit + dockerComposeRef + link + ; +} diff --git a/src/nix/modules/service/docker-compose-service.nix b/src/nix/modules/service/docker-compose-service.nix index 6b64e84..350c215 100644 --- a/src/nix/modules/service/docker-compose-service.nix +++ b/src/nix/modules/service/docker-compose-service.nix @@ -10,10 +10,11 @@ let inherit (lib) mkOption types; inherit (types) listOf nullOr attrsOf str either int bool submodule enum; - link = url: text: - ''link:${url}[${text}]''; - dockerComposeRef = fragment: - ''See ${link "https://docs.docker.com/compose/compose-file/#${fragment}" "Docker Compose#${fragment}"}''; + inherit (import ../../lib.nix { inherit lib; }) + link + dockerComposeRef + ; + dockerComposeKitchenSink = '' Analogous to the `docker run` counterpart.