From bb39d4e4bc869005454bd6f235a322ff641c4f31 Mon Sep 17 00:00:00 2001 From: "Adam C. Stephens" Date: Mon, 30 Mar 2026 12:22:05 -0400 Subject: [PATCH 1/4] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:nixos/nixpkgs/ffcdcf99d65c61956d882df249a9be53e5902ea5?narHash=sha256-lz718rr1BDpZBYk7%2BG8cE6wee3PiBUpn8aomG/vLLiY%3D' (2025-11-05) → 'github:nixos/nixpkgs/b63fe7f000adcfa269967eeff72c64cafecbbebe?narHash=sha256-CIS/4AMUSwUyC8X5g%2B5JsMRvIUL3YUfewe8K4VrbsSQ%3D' (2026-03-28) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 4159b96..e7b90a8 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1762361079, - "narHash": "sha256-lz718rr1BDpZBYk7+G8cE6wee3PiBUpn8aomG/vLLiY=", + "lastModified": 1774701658, + "narHash": "sha256-CIS/4AMUSwUyC8X5g+5JsMRvIUL3YUfewe8K4VrbsSQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ffcdcf99d65c61956d882df249a9be53e5902ea5", + "rev": "b63fe7f000adcfa269967eeff72c64cafecbbebe", "type": "github" }, "original": { From af784e56e9ccef3bb90b7ef97c7e944b0afc938c Mon Sep 17 00:00:00 2001 From: "Adam C. Stephens" Date: Fri, 27 Mar 2026 03:38:41 +0000 Subject: [PATCH 2/4] Handle fixed point buildRebar3/buildMix builders --- fixtures/example/deps.nix | 10 ++++------ lib/deps_nix.ex | 7 +++---- lib/deps_nix/derivation.ex | 2 +- test/deps_nix/special_treatment_test.exs | 2 +- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/fixtures/example/deps.nix b/fixtures/example/deps.nix index 168339b..927b2d0 100644 --- a/fixtures/example/deps.nix +++ b/fixtures/example/deps.nix @@ -1,7 +1,6 @@ { lib, beamPackages, - cmake, extend, lexbor, fetchFromGitHub, @@ -50,7 +49,7 @@ let inherit (fenix) cargo rustc; }).buildRustPackage { - pname = "${old.packageName}-native"; + pname = "${old.beamModuleName}-native"; version = old.version; src = nativeDir; cargoLock = { @@ -82,7 +81,7 @@ let done ''; - buildPhase = '' + preBuild = '' suggestion() { echo "***********************************************" echo " deps_nix " @@ -99,12 +98,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} ''; }; @@ -1492,7 +1490,7 @@ let name = "vix"; appConfigPath = ./config; - VIX_COMPILATION_MODE = "PLATFORM_PROVIDED_LIBVIPS"; + env.VIX_COMPILATION_MODE = "PLATFORM_PROVIDED_LIBVIPS"; nativeBuildInputs = [ pkg-config diff --git a/lib/deps_nix.ex b/lib/deps_nix.ex index 6384e55..5f520ef 100644 --- a/lib/deps_nix.ex +++ b/lib/deps_nix.ex @@ -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 = { @@ -291,7 +291,7 @@ defmodule DepsNix do done ''; - buildPhase = '' + preBuild = '' suggestion() { echo "***********************************************" echo " deps_nix " @@ -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} ''; }; diff --git a/lib/deps_nix/derivation.ex b/lib/deps_nix/derivation.ex index 62b4efa..07a22bb 100644 --- a/lib/deps_nix/derivation.ex +++ b/lib/deps_nix/derivation.ex @@ -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 diff --git a/test/deps_nix/special_treatment_test.exs b/test/deps_nix/special_treatment_test.exs index 4a08c3b..f509a96 100644 --- a/test/deps_nix/special_treatment_test.exs +++ b/test/deps_nix/special_treatment_test.exs @@ -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 From ac9223d218a19caedd66a2210cfa1a02e7dc07cf Mon Sep 17 00:00:00 2001 From: "Adam C. Stephens" Date: Mon, 30 Mar 2026 12:43:13 -0400 Subject: [PATCH 3/4] update devshells - nixfmt-rfc-style -> nixfmt - use a shared beamPackages everywhere - remove confusing `with pkgs;` --- flake.nix | 7 +++++-- shells/ci.nix | 13 +++++++------ shells/local.nix | 21 ++++++++++----------- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/flake.nix b/flake.nix index e39e87a..f7c1971 100644 --- a/flake.nix +++ b/flake.nix @@ -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; }; } ); diff --git a/shells/ci.nix b/shells/ci.nix index cebcd22..b2f54ce 100644 --- a/shells/ci.nix +++ b/shells/ci.nix @@ -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 ]; } diff --git a/shells/local.nix b/shells/local.nix index 3bae58b..3ade5f1 100644 --- a/shells/local.nix +++ b/shells/local.nix @@ -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 @@ -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 ]; } From ee210b019ab0d36dc7d98f611e068537572df25e Mon Sep 17 00:00:00 2001 From: "Adam C. Stephens" Date: Mon, 30 Mar 2026 13:42:25 -0400 Subject: [PATCH 4/4] update fixture vix to 0.38 to fix build failure --- fixtures/example/deps.nix | 5 +++-- fixtures/example/mix.lock | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fixtures/example/deps.nix b/fixtures/example/deps.nix index 927b2d0..abaaf1e 100644 --- a/fixtures/example/deps.nix +++ b/fixtures/example/deps.nix @@ -1,6 +1,7 @@ { lib, beamPackages, + cmake, extend, lexbor, fetchFromGitHub, @@ -1484,7 +1485,7 @@ let vix = let - version = "0.35.0"; + version = "0.38.0"; drv = buildMix { inherit version; name = "vix"; @@ -1500,7 +1501,7 @@ let src = fetchHex { inherit version; pkg = "vix"; - sha256 = "a3e80067a89d0631b6cf2b93594e03c1b303a2c7cddbbdd28040750d521984e5"; + sha256 = "dca58f654922fa678d5df8e028317483d9c0f8acb2e2714076a8468695687aa7"; }; beamDeps = [ diff --git a/fixtures/example/mix.lock b/fixtures/example/mix.lock index ab84d4c..dad0cac 100644 --- a/fixtures/example/mix.lock +++ b/fixtures/example/mix.lock @@ -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"}, }