NixOS instead of Amazon Linux for ECS hosts

Is anyone using NixOS instead of Amazon Linux for ECS hosts? If so, is there some existing support to do this?

Does it ever lag in terms of agent versions supported, etc.?

Does it run stable?

One downside is that Amazon support becomes more difficult.

Hydra as far as I know uses Amazon autoscaling groups to build packages depending on the queue size. So there is a certain interest on the NixOS side to keep Amazon support stable.
Personally I do not have a serious deployment on EC2 since I only have a single machine there that I use for benchmarks. I did not notice any problems while using it with nixops.
However I am pretty sure that somebody else can share their experience with bigger deployments.

1 Like

Didn’t use it myself, but there is ecs agent module:
https://github.com/NixOS/nixpkgs/blob/92a047a6c4d46a222e9c323ea85882d0a7a13af8/nixos/modules/virtualisation/ecs-agent.nix

Sorry I did not read about ECS. I only used EC2 with NixOS. I have no experience with ECS.

I’m experimenting with various deployment methods to ECS.

  • dockerTools. Working on improving the dockerTools ecosystem to speed up iteration
  • sparse nix container that takes environment variables and runs ‘nix run $ENV_PATH —substituters $SUBSTITUTERS $NIX_RUN_ARGS -c $RUN_CMD
  • sparse nix containers bind mounted to the host /nix for free caching of paths between tasks/services on that host.

Still trying to find a good minimal container that can ‘nix run’ and does the right thing wrt /nix, SSL_CA_FILE, permissions etc.

Have not yet tried to have the host be NixOS. This may improve the /nix store approach, but would still need a smooth deployment strategy for the containers.