Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions fixtures/example/deps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ let
inherit (fenix) cargo rustc;
}).buildRustPackage
{
pname = "${old.packageName}-native";
pname = "${old.beamModuleName}-native";
version = old.version;
src = nativeDir;
cargoLock = {
Expand Down Expand Up @@ -82,7 +82,7 @@ let
done
'';

buildPhase = ''
preBuild = ''
suggestion() {
echo "***********************************************"
echo " deps_nix "
Expand All @@ -99,12 +99,11 @@ let
echo -n " "
grep -Rl 'use RustlerPrecompiled' lib \
| xargs grep 'defmodule' \
| sed 's/defmodule \(.*\) do/config :${old.packageName}, \1, skip_compilation?: true/'
| sed 's/defmodule \(.*\) do/config :${old.beamModuleName}, \1, skip_compilation?: true/'
echo "***********************************************"
exit 1
}
trap suggestion ERR
${old.buildPhase}
'';
};

Expand Down Expand Up @@ -1486,13 +1485,13 @@ let

vix =
let
version = "0.35.0";
version = "0.38.0";
drv = buildMix {
inherit version;
name = "vix";
appConfigPath = ./config;

VIX_COMPILATION_MODE = "PLATFORM_PROVIDED_LIBVIPS";
env.VIX_COMPILATION_MODE = "PLATFORM_PROVIDED_LIBVIPS";

nativeBuildInputs = [
pkg-config
Expand All @@ -1502,7 +1501,7 @@ let
src = fetchHex {
inherit version;
pkg = "vix";
sha256 = "a3e80067a89d0631b6cf2b93594e03c1b303a2c7cddbbdd28040750d521984e5";
sha256 = "dca58f654922fa678d5df8e028317483d9c0f8acb2e2714076a8468695687aa7";
};

beamDeps = [
Expand Down
2 changes: 1 addition & 1 deletion fixtures/example/mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@
"unicode": {:hex, :unicode, "1.20.0", "10189cfe98b03ebb8be6efd00df0936c1c94d75bfbd62cba2bdf958fef3ee4a7", [:mix], [], "hexpm", "fa581cf80b3b1b7f42e4d24a69109dfac465cec27a62c661306c81f4ab35894c"},
"unicode_set": {:hex, :unicode_set, "1.5.0", "f2dcc40b1e8daf1a04433c705d9a8fb8ccdfc8fd5763a92d414a3e0775414cfb", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:unicode, "~> 1.13", [hex: :unicode, repo: "hexpm", optional: false]}], "hexpm", "6c7f200e52fb90434d6b783eaa4e0ea303cfc4844ea25b2fc1ba3eb8a6901b11"},
"unicode_string": {:hex, :unicode_string, "1.7.0", "900f35a08a0f9f5791f0e110a762e0058efa97e54b409b953f2b153ae198da6c", [:mix], [{:ex_cldr, "~> 2.38", [hex: :ex_cldr, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:sweet_xml, "~> 0.7", [hex: :sweet_xml, repo: "hexpm", optional: false]}, {:trie, "~> 2.0", [hex: :trie, repo: "hexpm", optional: false]}, {:unicode, "~> 1.19", [hex: :unicode, repo: "hexpm", optional: false]}, {:unicode_set, "~> 1.5", [hex: :unicode_set, repo: "hexpm", optional: false]}], "hexpm", "490f0550a1c9c70b869284975f81e09a7f9de0381e1b2d43e0779e60934b41f2"},
"vix": {:hex, :vix, "0.35.0", "f6319b715e3b072e53eba456a21af5f2ff010a7a7b19b884600ea98a0609b18c", [:make, :mix], [{:cc_precompiler, "~> 0.1.4 or ~> 0.2", [hex: :cc_precompiler, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.7.3 or ~> 0.8", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:kino, "~> 0.7", [hex: :kino, repo: "hexpm", optional: true]}], "hexpm", "a3e80067a89d0631b6cf2b93594e03c1b303a2c7cddbbdd28040750d521984e5"},
"vix": {:hex, :vix, "0.38.0", "77529ee4f6ced339c3d5f90a9eacf306f5b7109d3d1b5e3ef391a984ad404f75", [:make, :mix], [{:cc_precompiler, "~> 0.1.4 or ~> 0.2", [hex: :cc_precompiler, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.7.3 or ~> 0.8", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:kino, "~> 0.7", [hex: :kino, repo: "hexpm", optional: true]}], "hexpm", "dca58f654922fa678d5df8e028317483d9c0f8acb2e2714076a8468695687aa7"},
"websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"},
}
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@

devShells = forAllSystems (
{ pkgs, ... }:
let
beamPackages = pkgs.beam28Packages.extend (_: prev: { elixir = prev.elixir_1_19; });
in
{
default = pkgs.callPackage ./shells/local.nix { };
ci = pkgs.callPackage ./shells/ci.nix { };
default = pkgs.callPackage ./shells/local.nix { inherit beamPackages; };
ci = pkgs.callPackage ./shells/ci.nix { inherit beamPackages; };
}
);

Expand Down
7 changes: 3 additions & 4 deletions lib/deps_nix.ex
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ defmodule DepsNix do
inherit (fenix) cargo rustc;
}).buildRustPackage
{
pname = "${old.packageName}-native";
pname = "${old.beamModuleName}-native";
version = old.version;
src = nativeDir;
cargoLock = {
Expand Down Expand Up @@ -291,7 +291,7 @@ defmodule DepsNix do
done
'';

buildPhase = ''
preBuild = ''
suggestion() {
echo "***********************************************"
echo " deps_nix "
Expand All @@ -308,12 +308,11 @@ defmodule DepsNix do
echo -n " "
grep -Rl 'use RustlerPrecompiled' lib \\
| xargs grep 'defmodule' \\
| sed 's/defmodule \\(.*\\) do/config :${old.packageName}, \\1, skip_compilation?: true/'
| sed 's/defmodule \\(.*\\) do/config :${old.beamModuleName}, \\1, skip_compilation?: true/'
echo "***********************************************"
exit 1
}
trap suggestion ERR
${old.buildPhase}
'';
};

Expand Down
2 changes: 1 addition & 1 deletion lib/deps_nix/derivation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ defmodule DepsNix.Derivation do
inherit version;
name = "#{drv.name}";#{format_app_config_path(drv)}

VIX_COMPILATION_MODE = "PLATFORM_PROVIDED_LIBVIPS";
env.VIX_COMPILATION_MODE = "PLATFORM_PROVIDED_LIBVIPS";

nativeBuildInputs = [
pkg-config
Expand Down
13 changes: 7 additions & 6 deletions shells/ci.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{ pkgs }:
{
beamPackages,
pkgs,
}:

with pkgs;

mkShell {
pkgs.mkShell {
packages = [
beamPackages.hex
elixir_1_19
nixfmt-rfc-style
beamPackages.elixir
pkgs.nixfmt-rfc-style
];
}
21 changes: 10 additions & 11 deletions shells/local.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{ pkgs }:
{ beamPackages, pkgs }:

with pkgs;

mkShell {
pkgs.mkShell {
packages =
let
release = writeShellApplication {
release = pkgs.writeShellApplication {
name = "release";
runtimeInputs = [
elixir_1_19
gh
beamPackages.elixir
beamPackages.hex
pkgs.gh
];
text = ''
tag=$1
Expand All @@ -21,10 +20,10 @@ mkShell {
in
[
beamPackages.hex
elixir_1_19
elixir-ls
gh
nixfmt-rfc-style
beamPackages.elixir
beamPackages.elixir-ls
pkgs.gh
pkgs.nixfmt
release
];
}
2 changes: 1 addition & 1 deletion test/deps_nix/special_treatment_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ defmodule DepsNix.SpecialTreatmentTest do
name = "vix";
appConfigPath = ./config;

VIX_COMPILATION_MODE = "PLATFORM_PROVIDED_LIBVIPS";
env.VIX_COMPILATION_MODE = "PLATFORM_PROVIDED_LIBVIPS";

nativeBuildInputs = [
pkg-config
Expand Down
Loading