{ description = "minimal flake for elixir dev"; inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1"; outputs = {self, ...} @ inputs: let supportedSystems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; forEachSupportedSystem = f: inputs.nixpkgs.lib.genAttrs supportedSystems ( system: f { inherit system; pkgs = import inputs.nixpkgs { inherit system; overlays = [inputs.self.overlays.default]; }; } ); in { overlays.default = final: prev: rec { erlang = final.beam.interpreters.erlang_27; pkgs-beam = final.beam.packagesWith erlang; elixir = pkgs-beam.elixir_1_17; }; devShells = forEachSupportedSystem ( { pkgs, system, }: { default = pkgs.mkShellNoCC { packages = with pkgs; [ elixir self.formatter.${system} ] ++ # Linux only pkgs.lib.optionals pkgs.stdenv.isLinux ( with pkgs; [ gigalixir inotify-tools libnotify ] ); }; } ); formatter = forEachSupportedSystem ({pkgs, ...}: pkgs.nixfmt); }; }