Skip to content

Instantly share code, notes, and snippets.

@ericr3r
Last active May 12, 2023 18:19
Show Gist options
  • Save ericr3r/d299b3905b26c2ec6a82de6f359a75bc to your computer and use it in GitHub Desktop.
Save ericr3r/d299b3905b26c2ec6a82de6f359a75bc to your computer and use it in GitHub Desktop.
{
description = "Nerves build environment";
inputs = {
nixpkgs = { url = "github:NixOS/nixpkgs/nixos-22.11"; };
flake-utils = { url = "github:numtide/flake-utils"; };
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
inherit (nixpkgs.lib) optional;
pkgs = import nixpkgs { inherit system; };
# Set the Erlang version
erlangVersion = "erlangR25";
# Set the Elixir version
elixirVersion = "elixir_1_14";
erlang = pkgs.beam.interpreters.${erlangVersion};
elixir = pkgs.beam.packages.${erlangVersion}.${elixirVersion};
elixir_ls = pkgs.beam.packages.${erlangVersion}.elixir_ls;
libPath = with pkgs; lib.makeLibraryPath [
pkgs.stdenv.cc.cc
];
in
{
devShell = with pkgs; mkShell
{
buildInputs = [
elixir
pkgs.autoconf
pkgs.automake
pkgs.curl
pkgs.fwup
pkgs.git
pkgs.rebar3
pkgs.squashfsTools
pkgs.x11_ssh_askpass
pkgs.pkg-config
];
NIX_LD_LIBRARY_PATH = libPath;
NIX_LD = lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker";
};
}
);
}
@ericr3r
Copy link
Author

ericr3r commented Mar 15, 2023

Does require use flake . --impure but works on the nerves blinky example.

@ericr3r
Copy link
Author

ericr3r commented Mar 15, 2023

Also requires programs.nix-ld.enable = true; in configuration.nix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment