79 lines
1.9 KiB
Nix
79 lines
1.9 KiB
Nix
# [[file:deploying.org::*Container build with \[\[file:../cce_nixos_core.org\]\[Nix\]\]][Container build with [[file:../cce_nixos_core.org][Nix]]:2]]
|
|
{
|
|
mixOverlay ? builtins.fetchGit {
|
|
url = "https://github.com/hauleth/nix-elixir.git";
|
|
rev = "8bdf6e73e3c5fa0706b2d1936bceb1baf692ed96";
|
|
},
|
|
rebarOverlay ? ./rebar-overlay.nix,
|
|
pkgs ? import <nixpkgs> {
|
|
overlays = [ (import mixOverlay) (import rebarOverlay) ];
|
|
},
|
|
|
|
version,
|
|
installDebugTools ? false,
|
|
src ? ./.,
|
|
mixSha256 ? "0c19n0gn0xvhjg60dhsvdnvxk3kvdyf3pr12p8xzhb60jp17sw5z",
|
|
# mixSha256 ? pkgs.stdenv.lib.fakeSha256,
|
|
}:
|
|
|
|
let
|
|
erlang = pkgs.beam.interpreters.erlangR23;
|
|
packages = pkgs.beam.packagesWith erlang;
|
|
|
|
elixir = packages.elixir_1_11;
|
|
|
|
nodejs = pkgs.nodejs-10_x;
|
|
in packages.buildMix'' {
|
|
name = "arcology";
|
|
pname = "arcology";
|
|
inherit version;
|
|
inherit src;
|
|
inherit mixSha256;
|
|
|
|
buildInputs = [
|
|
elixir
|
|
nodejs
|
|
|
|
# needed for distillery release invocation
|
|
pkgs.bashInteractive
|
|
pkgs.coreutils
|
|
pkgs.gnused
|
|
pkgs.gnugrep
|
|
pkgs.gawk
|
|
pkgs.zlib
|
|
|
|
pkgs.gcc
|
|
|
|
# libraries specified in autoPatchelfHook for the distillery package
|
|
pkgs.openssl
|
|
pkgs.systemd
|
|
pkgs.ncurses
|
|
|
|
pkgs.inotify-tools
|
|
pkgs.pandoc
|
|
pkgs.emacs-nox
|
|
|
|
pkgs.emacs26Packages.use-package
|
|
pkgs.emacs26Packages.elixir-mode
|
|
pkgs.emacs26Packages.nix-mode
|
|
pkgs.emacs26Packages.erlang
|
|
pkgs.emacs26Packages.yaml-mode
|
|
];
|
|
nativeBuildInputs = [
|
|
pkgs.autoPatchelfHook
|
|
pkgs.gnumake
|
|
pkgs.git
|
|
];
|
|
preConfigure = ''
|
|
make tangle
|
|
echo "tangled"
|
|
'';
|
|
buildPhase = ''
|
|
mix compile --no-deps-check
|
|
mix phx.digest
|
|
mkdir -p $out/opt/arcology/
|
|
mix release --path $out/opt/arcology
|
|
'';
|
|
}
|
|
# Container build with [[file:../cce_nixos_core.org][Nix]]:2 ends here
|