hercules-ci / arion

Run docker-compose with help from Nix/NixOS
Apache License 2.0
622 stars 48 forks source link

Support services.<name>.service.networks.<name>.aliases #205

Open peacememories opened 1 year ago

peacememories commented 1 year ago

I am currently trialing Arion as a replacement for our docker-compose development environment, with the hopes of transitioning our container building over to Nix. While transcribing the docker-compose.yml, I've run into a few config fields currently have no equivalent in Arion. One of them is networks.<name>.aliases, which we use to give a redis server two different names (don't ask, that way lies only pain and disappointment).

I am particularly confused since the list of configuration options describes services.<name>.service.networks as

(list of string) or attribute set of (submodule)

which suggests to me that it would support configuration options. But when I try the following structure:

# ...
redis = {
    service.image = "bitnami/redis:6.2.4";
    service.networks.default.aliases = ["ot-connector-redis"];
};
# ...

I get the following error:

error: A definition for option `services.redis.service.networks' is not of type `null or (list of string)'. Definition values:
       - In `<project>/arion-compose.nix':
           {
             default = {
               aliases = [
                 "ot-connector-redis"
               ];
           ...

I am currently running nixos-23.05, which ships with arion-0.2.0.0 for what it's worth.