diff --git a/pkgs/by-name/li/livebook/package.nix b/pkgs/by-name/li/livebook/package.nix index 64dc8150c8d9..9c62889ae2df 100644 --- a/pkgs/by-name/li/livebook/package.nix +++ b/pkgs/by-name/li/livebook/package.nix @@ -1,63 +1 @@ -{ - lib, - beamMinimal28Packages, - makeWrapper, - fetchFromGitHub, - nixosTests, - nix-update-script, -}: -let - beamPackages = beamMinimal28Packages; -in -beamPackages.mixRelease rec { - pname = "livebook"; - version = "0.16.4"; - - inherit (beamPackages) elixir; - - buildInputs = [ beamPackages.erlang ]; - - nativeBuildInputs = [ makeWrapper ]; - - src = fetchFromGitHub { - owner = "livebook-dev"; - repo = "livebook"; - tag = "v${version}"; - hash = "sha256-Cwzcoslqjaf7z9x2Sgnzrrl4zUcH2f7DEWaFPBIi3ms="; - }; - - mixFodDeps = beamPackages.fetchMixDeps { - pname = "mix-deps-${pname}"; - inherit src version; - hash = "sha256-OEYkWh0hAl7ZXP2Cq+TgVGF4tnWlpF6W5uRSdyrswlA="; - }; - - postInstall = '' - wrapProgram $out/bin/livebook \ - --prefix PATH : ${ - lib.makeBinPath [ - beamPackages.elixir - beamPackages.erlang - ] - } \ - --set MIX_REBAR3 ${beamPackages.rebar3}/bin/rebar3 - ''; - - passthru = { - updateScript = nix-update-script { }; - tests = { - livebook-service = nixosTests.livebook-service; - }; - }; - - meta = { - license = lib.licenses.asl20; - homepage = "https://livebook.dev/"; - description = "Automate code & data workflows with interactive Elixir notebooks"; - maintainers = with lib.maintainers; [ - munksgaard - scvalex - ]; - platforms = lib.platforms.unix; - }; -} +{ beamMinimal28Packages }: beamMinimal28Packages.livebook diff --git a/pkgs/development/beam-modules/default.nix b/pkgs/development/beam-modules/default.nix index 8b04fe8a07a7..c27feb625885 100644 --- a/pkgs/development/beam-modules/default.nix +++ b/pkgs/development/beam-modules/default.nix @@ -94,6 +94,8 @@ let lfe = lfe_2_1; lfe_2_1 = lib'.callLFE ../interpreters/lfe/2.1.nix { inherit erlang buildRebar3 buildHex; }; + livebook = callPackage ./livebook { }; + # Non hex packages. Examples how to build Rebar/Mix packages with and # without helper functions buildRebar3 and buildMix. hex = callPackage ./hex { }; diff --git a/pkgs/development/beam-modules/livebook/default.nix b/pkgs/development/beam-modules/livebook/default.nix new file mode 100644 index 000000000000..a4ccd6695bcc --- /dev/null +++ b/pkgs/development/beam-modules/livebook/default.nix @@ -0,0 +1,61 @@ +{ + lib, + beamPackages, + makeWrapper, + fetchFromGitHub, + nixosTests, + nix-update-script, +}: + +beamPackages.mixRelease rec { + pname = "livebook"; + version = "0.16.4"; + + inherit (beamPackages) elixir; + + buildInputs = [ beamPackages.erlang ]; + + nativeBuildInputs = [ makeWrapper ]; + + src = fetchFromGitHub { + owner = "livebook-dev"; + repo = "livebook"; + tag = "v${version}"; + hash = "sha256-Cwzcoslqjaf7z9x2Sgnzrrl4zUcH2f7DEWaFPBIi3ms="; + }; + + mixFodDeps = beamPackages.fetchMixDeps { + pname = "mix-deps-${pname}"; + inherit src version; + hash = "sha256-OEYkWh0hAl7ZXP2Cq+TgVGF4tnWlpF6W5uRSdyrswlA="; + }; + + postInstall = '' + wrapProgram $out/bin/livebook \ + --prefix PATH : ${ + lib.makeBinPath [ + beamPackages.elixir + beamPackages.erlang + ] + } \ + --set MIX_REBAR3 ${beamPackages.rebar3}/bin/rebar3 + ''; + + passthru = { + updateScript = nix-update-script { }; + tests = { + livebook-service = nixosTests.livebook-service; + }; + }; + + meta = { + license = lib.licenses.asl20; + homepage = "https://livebook.dev/"; + description = "Automate code & data workflows with interactive Elixir notebooks"; + maintainers = with lib.maintainers; [ + munksgaard + scvalex + ]; + platforms = lib.platforms.unix; + }; +}