portal/flake.nix
Mikael Hugo 454e9b83ba fix: use cached erlang in devShell (avoid full recompile)
Drop the headless override — standard beamPackages.erlang (OTP 28.5)
is already in binary cache, so nix develop resolves instantly.
Elixir 1.20.0-rc.4 still built from source (takes ~2min first time).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-11 11:59:04 +02:00

52 lines
1.7 KiB
Nix

{
description = "CentralCloud unified portal (Elixir/Phoenix umbrella)";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
flake-utils.url = "github:numtide/flake-utils";
};
nixConfig = {
extra-substituters = [
"https://cache.centralcloud.com/default"
];
extra-trusted-public-keys = [
"default:ywfU21WX06iOn2Ec2lae1jYh4w8LO4IQkmp06vJzsk8="
];
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
# Elixir 1.20.0-rc.4 — not yet in nixpkgs; override elixir_1_19 against cached OTP 28
# Uses standard erlang (already in binary cache) to avoid full recompile
elixir_1_20_rc4 = pkgs.beamPackages.elixir_1_19.overrideAttrs (_old: {
version = "1.20.0-rc.4";
src = pkgs.fetchFromGitHub {
owner = "elixir-lang";
repo = "elixir";
rev = "v1.20.0-rc.4";
hash = "sha256-sboB+GW3T+t9gEcOGtd6NllmIlyWio1+cgWyyxE+484=";
};
});
in {
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
elixir_1_20_rc4 # 1.20.0-rc.4 built from source against OTP 28
pkgs.beamPackages.erlang # OTP 28.5 (from binary cache)
nodejs_22 # 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)"
'';
};
});
}