mirror of
https://github.com/hercules-ci/arion.git
synced 2024-11-23 00:32:12 +03:00
Use the word 'composition' where applicable.
Also adds some documentation to celebrate that we can now - with ease - verbally distinguish between composition-level modules and service-level modules.
This commit is contained in:
parent
e7ad732bb3
commit
23ee554f2f
@ -140,7 +140,7 @@ do_eval() {
|
||||
echo 1>&2 "Evaluating configuration..."
|
||||
# read-write-mode is required for import from derivation
|
||||
nix-instantiate \
|
||||
"$nix_dir/eval-docker-compose.nix" \
|
||||
"$nix_dir/eval-composition.nix" \
|
||||
--eval \
|
||||
--read-write-mode \
|
||||
--json \
|
||||
@ -155,7 +155,7 @@ do_eval() {
|
||||
do_build() {
|
||||
echo 1>&2 "Building configuration..."
|
||||
nix-build \
|
||||
"$nix_dir/eval-docker-compose.nix" \
|
||||
"$nix_dir/eval-composition.nix" \
|
||||
--out-link $docker_compose_yaml \
|
||||
--argstr uid "$UID" \
|
||||
--arg modules "$modules" \
|
||||
@ -190,7 +190,7 @@ To bring the top-level Nixpkgs attributes into scope
|
||||
|
||||
EOF
|
||||
cat >"$REPL_TMP" <<EOF
|
||||
import $nix_dir/eval-docker-compose.nix {
|
||||
import $nix_dir/eval-composition.nix {
|
||||
uid = "$UID";
|
||||
modules = $modules;
|
||||
pkgs = $pkgs_argument;
|
||||
|
@ -1,3 +1,14 @@
|
||||
/*
|
||||
|
||||
This is a composition-level module.
|
||||
|
||||
It defines the low-level options that are read by arion, like
|
||||
- build.dockerComposeYaml
|
||||
|
||||
It declares options like
|
||||
- docker-compose.services
|
||||
|
||||
*/
|
||||
{ pkgs, uid, lib, config, ... }:
|
||||
|
||||
let
|
||||
|
@ -11,7 +11,7 @@ let
|
||||
|
||||
inherit (pkgs) lib;
|
||||
|
||||
composite = lib.evalModules {
|
||||
composition = lib.evalModules {
|
||||
check = true;
|
||||
modules = builtinModules ++ modules;
|
||||
};
|
||||
@ -22,12 +22,12 @@ let
|
||||
];
|
||||
|
||||
argsModule = {
|
||||
_file = ./eval-docker-compose.nix;
|
||||
key = ./eval-docker-compose.nix;
|
||||
_file = ./eval-composition.nix;
|
||||
key = ./eval-composition.nix;
|
||||
config._module.args.pkgs = lib.mkIf (pkgs != null) (lib.mkForce pkgs);
|
||||
config._module.args.uid = uid;
|
||||
};
|
||||
|
||||
in
|
||||
# Typically you need composite.config.build.dockerComposeYaml
|
||||
composite
|
||||
# Typically you need composition.config.build.dockerComposeYaml
|
||||
composition
|
@ -1,4 +1,9 @@
|
||||
# Bind-mounts the host store
|
||||
/*
|
||||
|
||||
This service-level bind mounts the host store into the container
|
||||
when the service.useHostStore option is set to true.
|
||||
|
||||
*/
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib) mkOption types mkIf;
|
||||
|
@ -1,3 +1,9 @@
|
||||
/*
|
||||
|
||||
This service-level module defines the build.service option, using
|
||||
the user-facing options service.image, service.volumes, etc.
|
||||
|
||||
*/
|
||||
{ pkgs, lib, config, ... }:
|
||||
|
||||
let
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
let
|
||||
# To make some prebuilt derivations available in the vm
|
||||
preEval = import ../../src/nix/eval-docker-compose.nix {
|
||||
preEval = import ../../src/nix/eval-composition.nix {
|
||||
modules = [ ../../examples/minimal/arion-compose.nix ];
|
||||
inherit pkgs;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user