hercules-ci / arion

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

Change generated systemd file content #154

Closed aacebedo closed 2 years ago

aacebedo commented 2 years ago

Hi

I ported a docker compose setup on Arion and I am facing a small issue. My containers use volumes pointing to remote nfs and iscsi directories. However Arion containers are started before the mounts have been completed. This leads to failing containers.

How can I add some "requires" attributes to systemd units generated by arion ?

roberth commented 2 years ago

This should work the same as it would in "normal" NixOS.

Something like

  services.my-service.nixos.configuration.systemd.services.my-systemd-service.requires = "foo-bar-baz.mount";

IIUC, the in-container systemd will materialize such mount units when it learns about them from the kernel. I suppose this just works; otherwise, you might have to create a service unit that polls.

aacebedo commented 2 years ago

Great that worked thanks !