Extract dockerComposeRef and link into new lib.nix
This commit is contained in:
parent
42146bb0b2
commit
c8944a2871
2 changed files with 21 additions and 4 deletions
16
src/nix/lib.nix
Normal file
16
src/nix/lib.nix
Normal 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
|
||||||
|
;
|
||||||
|
}
|
|
@ -10,10 +10,11 @@ let
|
||||||
inherit (lib) mkOption types;
|
inherit (lib) mkOption types;
|
||||||
inherit (types) listOf nullOr attrsOf str either int bool submodule enum;
|
inherit (types) listOf nullOr attrsOf str either int bool submodule enum;
|
||||||
|
|
||||||
link = url: text:
|
inherit (import ../../lib.nix { inherit lib; })
|
||||||
''link:${url}[${text}]'';
|
link
|
||||||
dockerComposeRef = fragment:
|
dockerComposeRef
|
||||||
''See ${link "https://docs.docker.com/compose/compose-file/#${fragment}" "Docker Compose#${fragment}"}'';
|
;
|
||||||
|
|
||||||
dockerComposeKitchenSink = ''
|
dockerComposeKitchenSink = ''
|
||||||
Analogous to the `docker run` counterpart.
|
Analogous to the `docker run` counterpart.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue