Arion Options
enableDefaultNetwork
Whether to define the default network:
networks.default = {
name = config.project.name;
};
Type: boolean
Default: true
docker-compose.extended
Attribute set that will be turned into the x-arion section of the docker-compose.yaml file.
Type: attribute set
docker-compose.raw
Attribute set that will be turned into the docker-compose.yaml file, using Nix’s toJSON builtin.
Type: attribute set
docker-compose.volumes
A attribute set of volume configurations.
Type: attribute set of unspecified value
Default: { }
host.nixStorePrefix
Prefixes store paths on the host, allowing the Nix store to be stored at an alternate location without altering the format of store paths.
For example: instead of mounting the host’s /nix/store as the
container’s /nix/store, this will mount /mnt/foo/nix/store as
the container’s /nix/store.
Type: string
Default: ""
Example: "/mnt/foo"
host.uid
The numeric user id (UID) of the user running arion.
This lets you to write modules that interact with the host user’s files, which is helpful for local development, but not intended for production-like deployment scenarios.
Type: signed integer
networks
Type: lazy attribute set of (submodule)
networks.<name>.driver
"none", "host", or a platform-specific value. See
Compose
Spec Networks #driver
Type: string
networks.<name>.driver_opts
Type: lazy attribute set of raw value
networks.<name>.external
When true, don’t create or destroy the network, but assume that it
exists.
Type: boolean
networks.<name>.name
Set a custom name for the network.
It shares a namespace with other projects’ networks. name is used
as-is.
Note the default network’s default name is set to
project.name by Arion.
Type: string
out.dockerComposeYaml
A derivation that produces a docker-compose.yaml file for this composition.
Type: package (read only)
out.dockerComposeYamlAttrs
The text of out.dockerComposeYaml.
Type: attribute set of unspecified value (read only)
project.name
Name of the project.
This is not optional, because getting the project name from a directory name tends to produce different results for different repo checkout location names.
Type: string
services
An attribute set of service configurations. A service specifies how to run an image as a container.
Type: attribute set of (submodule)
services.<name>.image.enableRecommendedContents
Add the /bin/sh and /usr/bin/env symlinks and some lightweight
files.
Type: boolean
Default: false
services.<name>.image.fakeRootCommands
Commands that build the root of the container in the current working directory.
Type: strings concatenated with “\n”
Default: ""
services.<name>.image.name
A human readable name for the docker image.
Shows up in the docker ps output in the IMAGE column, among
other places.
Type: string
Default: "localhost/" + config.service.name
services.<name>.image.nixBuild
Whether to build this image with Nixpkgs’
dockerTools.buildLayeredImage and then load it with docker load.
By default, an image will be built with Nix unless service.image is
set. See also image.name, which defaults to the service name.
Type: boolean
services.<name>.image.rawConfig
This is a low-level fallback for when a container option has not been modeled in the Arion module system.
This attribute set does not have an appropriate merge function. Please
use the specific image options instead.
Run-time configuration of the container. A full list of the options is available in the Docker Image Specification v1.2.0.
Type: attribute set of unspecified value
Default: { }
services.<name>.nixos.build
NixOS build products from config.system.build, such as toplevel
and etc.
This option is unused by default, because not all images use NixOS.
One way to use this is to enable nixos.useSystemd, but the NixOS
configuration can be used in other ways.
Type: attribute set (read only)
services.<name>.nixos.configuration
Modules to add to the NixOS configuration.
This option is unused by default, because not all images use NixOS.
One way to use this is to enable nixos.useSystemd, but the NixOS
configuration can be used in other ways.
Type: (list of unspecified value) or unspecified value convertible to it
Default: { }
services.<name>.nixos.evaluatedConfig
Evaluated NixOS configuration, to be read by service-level modules.
This option is unused by default, because not all images use NixOS.
One way to use this is to enable nixos.useSystemd, but the NixOS
configuration can be used in other ways.
Type: attribute set (read only)
services.<name>.nixos.useSystemd
When enabled, call the NixOS systemd-based init system.
Configure NixOS with the nixos.configuration option.
Type: boolean
Default: false
services.<name>.out.extendedInfo
Information about a service to include in the Docker Compose file, but
that will not be used by the docker-compose command itself.
It will be inserted in x-arion.serviceInfo.<service.name>.
Type: attribute set of unspecified value
Default: { }
services.<name>.out.service
Raw input for the service in docker-compose.yaml.
You should not need to use this option. If anything is missing, please contribute the missing option.
This option is user accessible because it may serve as an escape hatch for some.
Type: attribute set of unspecified value
services.<name>.service.blkio_config
Block IO limits for the service.
Type: null or (submodule)
Default: null
Example:
{
weight = 300;
}
services.<name>.service.blkio_config.device_read_bps
Type: list of (submodule)
services.<name>.service.blkio_config.device_read_iops
Type: list of (submodule)
services.<name>.service.blkio_config.device_write_bps
Type: list of (submodule)
services.<name>.service.blkio_config.device_write_iops
Type: list of (submodule)
services.<name>.service.blkio_config.weight_device
Type: list of (submodule)
services.<name>.service.build.context
Locates a Dockerfile to use for creating an image to use in this service.
Type: null or string
Default: null
services.<name>.service.build.dockerfile
Sets an alternate Dockerfile. A relative path is resolved from the build context. docs.docker.com/compose/compose-file/build/#dockerfile
Type: null or string
Default: null
services.<name>.service.build.target
Defines the stage to build as defined inside a multi-stage Dockerfile. docs.docker.com/compose/compose-file/build/#target
Type: null or string
Default: null
services.<name>.service.capabilities
Enable/disable linux capabilities, or pick Docker’s default.
Setting a capability to true means that it will be “added”.
Setting it to false means that it will be “dropped”.
Omitted and null capabilities will therefore be set according to
Docker’s
default
list of capabilities.
Type: attribute set of (null or boolean)
Default: { }
Example:
{
ALL = true;
NET_ADMIN = false;
SYS_ADMIN = false;
}
services.<name>.service.defaultExec
Container program and arguments to invoke when calling
arion exec <service.name> without further arguments.
Type: list of string
Default:
[ "/bin/sh" ]
services.<name>.service.depends_on
Type: (list of string) or attribute set of (submodule)
Default: [ ]
services.<name>.service.healthcheck
Type: submodule
services.<name>.service.healthcheck.test
Type: null or (list of string)
Default: null
Example:
[ "CMD" "pg_isready" ]
services.<name>.service.hostStoreAsReadOnly
Adds a :ro (read-only) access mode to the host nix store bind mount.
Type: boolean
Default: true
services.<name>.service.labels
Type: attribute set of string
Default: { }
Example:
{
"com.example.foo" = "bar";
"traefik.enable" = "true";
"traefik.http.routers.my-service.entrypoints" = "web";
"traefik.http.routers.my-service.rule" = "Host(`my-service.localhost`)";
}
services.<name>.service.name
The name of the service - <name> in the composition-level
services.<name>
Type: string (read only)
services.<name>.service.networks
Type: (list of string) or attribute set of (submodule)
Default: [ ]
services.<name>.service.ports
Expose ports on host. “host:container” or structured.
Type: list of unspecified value
Default: [ ]
services.<name>.service.useHostNixDaemon
Make the host Nix daemon available.
Type: boolean
Default: false
services.<name>.service.useHostStore
Bind mounts the host store if enabled, avoiding copying.
Type: boolean
Default: false