hercules-ci / arion

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

how to integrate an arion-compose.nix into an existing nix system declaratively #196

Open crabdancing opened 1 year ago

crabdancing commented 1 year ago

Let's say I have my arion-compose.nix file -- how do I integrate it such that it can be called directly from my system flake, or a configuration.nix file?

cablespaghetti commented 1 year ago

I am also struggling with this. The documentation seems to be incomplete, I've yet to get anything to work.

roberth commented 1 year ago

Did you find this page? https://docs.hercules-ci.com/arion/deployment What's missing?

cablespaghetti commented 1 year ago

Did you find this page? https://docs.hercules-ci.com/arion/deployment What's missing?

I completely failed to get it to work without flakes. It says to import the module.nix from somewhere. In the end I found that on GitHub and then got an error about a missing default.nix.

I’ve since switched my config to flakes and I’m up and running now. However if there is a way without flakes, some hand holding for inexperienced users might be helpful.

midnightveil commented 1 year ago

works for me without flakes using the same method as agenix does:

{
  imports = let
    commit = "8868689d3fd8a2ec45f1f6ab9dcf74728c6d853f";
  in [
    "${builtins.fetchTarball {
      name = "arion-v0.2.10";
      url = "https://github.com/hercules-ci/arion/archive/${commit}.tar.gz";
      # obtained via nix-prefetch-url --unpack <url>
      sha256 = "0iil1zvslrza5plmbn27fh3kayx1wlzw2nwxjq3ca233i679m610";
    }}/nixos-module.nix"
  ];
}