{
  description = "CentralCloud unified portal (Elixir/Phoenix umbrella)";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = nixpkgs.legacyPackages.${system};
      in {
        devShells.default = pkgs.mkShell {
          buildInputs = with pkgs; [
            elixir
            erlang
            nodejs_22        # for Phoenix asset pipeline
            inotify-tools    # LiveReload on Linux
          ];

          shellHook = ''
            export MIX_HOME=$HOME/.mix
            export HEX_HOME=$HOME/.hex
            export PATH=$MIX_HOME/bin:$HEX_HOME/bin:$PATH
            echo "Elixir $(elixir --version | head -1)"
            echo "Mix $(mix --version)"
          '';
        };
      });
}
