I am trying the Elixir - Phoenix 1.8 Up and Running guide and it does not work:
$ nix# mix phx.server
Could not start dynamically linked executable: /home/me/dev/playground/elixir/phoenix/hello/_build/tailwind-linux-x64
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld
[info] Running HelloWeb.Endpoint with Bandit 1.8.0 at 0.0.0.0:4000 (http)
[info] Access HelloWeb.Endpoint at http://localhost:4000
Could not start dynamically linked executable: /home/me/dev/playground/elixir/phoenix/hello/_build/tailwind-linux-x64
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld
[watch] build finished, watching for changes...
Tailwind CSS cannot run so no css is available for the Up and Running startup Phoenix app.
After following the help link https://nix.dev/permalink/stub-ld, I added pkgs.tailwindcss_4 to my mkShell:
pkgs.mkShell {
buildInputs = basePackages ++ [
pkgs.poedit
pkgs.tailwindcss_4
vscodeWithExtension
]
++ optional pkgs.stdenv.isLinux pkgs.libnotify
++ optional pkgs.stdenv.isLinux pkgs.inotify-tools;
shellHook = ''
export ROOT_DIR="$PWD"
export LANG=C.UTF-8
# Erlang/Elixir environment
export MIX_HOME="$ROOT_DIR/.mix"
export HEX_HOME="$ROOT_DIR/.hex"
# Elixir iex shell history https://hexdocs.pm/iex/IEx.html#module-shell-history
export ERL_AFLAGS="-kernel shell_history enabled"
'';
};
But I am still having the same error. I am not sure what to do next, I feel a bit lost with this. Does anyone have any idea how to make that work?
Also, the nixpkgs manual about Phoenix project could benefit from an update.