Skip to content

Instantly share code, notes, and snippets.

@ejpcmac
Last active September 26, 2018 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ejpcmac/afb00d15e1bc5784dc9e3fb485ca144e to your computer and use it in GitHub Desktop.
Save ejpcmac/afb00d15e1bc5784dc9e3fb485ca144e to your computer and use it in GitHub Desktop.
Shell for Nerves projects
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
inherit (lib) optional optionals;
elixir = beam.packages.erlangR21.elixir_1_7;
in
mkShell {
buildInputs = [ elixir git fwup squashfsTools file ]
++ optional stdenv.isDarwin coreutils-prefixed # For Nerves on macOS.
++ optional stdenv.isLinux x11_ssh_askpass; # For Nerves on Linux.
# This hook is needed on Linux to make Nerves use the correct ssh_askpass.
shellHooks = optional stdenv.isLinux ''
export SUDO_ASKPASS=${x11_ssh_askpass}/libexec/x11-ssh-askpass
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment