Extract dockerComposeRef and link into new lib.nix

This commit is contained in:
Robert Hensing 2022-06-09 01:20:09 +02:00
parent 42146bb0b2
commit c8944a2871
2 changed files with 21 additions and 4 deletions

16
src/nix/lib.nix Normal file
View file

@ -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
;
}

View file

@ -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.