Last active
May 12, 2023 18:19
-
-
Save ericr3r/d299b3905b26c2ec6a82de6f359a75bc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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"; | |
}; | |
} | |
); | |
} |
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
Does require
use flake . --impure
but works on the nerves blinky example.