Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
refactor(packages): Reuse livebook derivation for livebook_bumblebee
Browse files Browse the repository at this point in the history
  • Loading branch information
shanesveller committed Mar 7, 2024
1 parent e137720 commit 4a9687b
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions local-parts/packages/livebook.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{lib, ...}: {
perSystem = {pkgs, ...}: let
perSystem = {
config,
pkgs,
...
}: let
beamPkgs = pkgs.beam.packages.erlangR26.extend (_final: prev: {
rebar3 = prev.rebar3.overrideAttrs (_old: {doCheck = false;});
});
Expand Down Expand Up @@ -44,21 +48,13 @@
meta.mainProgram = "livebook";
};

livebook_bumblebee = beamPkgs.mixRelease {
buildInputs = [];
nativeBuildInputs = [pkgs.makeWrapper];

inherit elixir hex mixFodDeps pname src version;

installPhase = ''
mix escript.build
mkdir -p $out/bin
cp ./livebook $out/bin
livebook_bumblebee = pkgs.symlinkJoin {
name = "livebook-with-gcc";
paths = with pkgs; [cmake gcc gnumake config.packages.livebook];
buildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/livebook \
--prefix PATH : ${lib.makeBinPath ([elixir erlang] ++ (with pkgs; [cmake gcc gnumake]))} \
--set MIX_REBAR3 ${rebar3}/bin/rebar3
--prefix PATH : ${lib.makeBinPath (with pkgs; [cmake gcc gnumake])}
'';

meta.mainProgram = "livebook";
Expand Down

0 comments on commit 4a9687b

Please sign in to comment.