phx.new pipeline doesn't work under NixOS for reasons of tailwindcss cannot be downloaded and run
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- elixir, nixos, nodejs, tailwindcss
- Domain
- build-system, cli, tooling
Research direction
Start by tracing the mix phx.new --install path that downloads and runs Tailwind CSS, then compare it with the NixOS setup and system packages described in the issue. Determine whether a project option can select system-provided tailwindcss and watchman; done means a standard NixOS environment can create and run a Phoenix project without the dynamic-linker failure.
Written by the indexing model from the issue text.
Description
A standard NixOS installation development environment for elixir (using beamMinimal28Packages.elixir_1_19, but also tested with older versions) , does not allow tailwindcss to run when downloaded by mix phx.new --install :
mix phx.new tailwindfail --no-ecto --install
...
$ mix phx.server
Compiling 14 files (.ex)
Generated tailwindfail app
Could not start dynamically linked executable: /home/tbrowne/scratch/teste/tailwindfail/_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
The fix is quite involved but does work:
https://discourse.nixos.org/t/cannot-run-tailwind-css-with-elixir-phoenix-1-8-project/69651/4
Can this be made smoother somehow? For example a mix option that would automatically configure the project to use system-provided nix packages tailwindcss and watchman?
For completeness, here's my nix develop flake that works with the above fix.
{
description = "A flake for building development environment of Phoenix project.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/master";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
with pkgs; {
devShells.default = mkShell {
buildInputs = [
beamMinimal28Packages.elixir_1_19
nodejs
tailwindcss_4
watchman
]
++ lib.optionals stdenv.isLinux [
# For ExUnit Notifier on Linux.
libnotify
# For file_system on Linux.
inotify-tools
]
++ lib.optionals stdenv.isDarwin ([
# For ExUnit Notifier on macOS.
terminal-notifier
# For file_system on macOS.
darwin.apple_sdk.frameworks.CoreFoundation
darwin.apple_sdk.frameworks.CoreServices
]);
shellHook = ''
# allows mix to work on the local directory
mkdir -p .nix-mix
mkdir -p .nix-hex
export MIX_HOME=$PWD/.nix-mix
export HEX_HOME=$PWD/.nix-hex
export ERL_LIBS=$HEX_HOME/lib/erlang/lib
# concats PATH
export PATH=$MIX_HOME/bin:$PATH
export PATH=$MIX_HOME/escripts:$PATH
export PATH=$HEX_HOME/bin:$PATH
# enables history for IEx
export ERL_AFLAGS="-kernel shell_history enabled -kernel shell_history_path '\"$PWD/.erlang-history\"'"
# Phoenix add phx.new if not already there
pattern=".nix-mix/archives/phx_new*"
files=$(compgen -G "$pattern")
if [ -z "$files" ]; then
mix archive.install hex phx_new
fi
'';
};
}
);
}
- Dominant language
- Elixir
- Stars
- 23.2k
- Forks
- 3.2k
- Avg merge
- 16h 35m
- Merged PRs (30d)
- 18
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from phoenixframework/phoenix
-
Binary pushes don't work over the LongPoll transportPossibly taken @mandar1045 claimed this 1 day ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
phoenixframework/phoenix#6906 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 56/100
phoenixframework/phoenix#6898 · 3 comments ·
Maintainers usually reply within 1 day
-
~p treats routes as static when they only start with a static directory namePossibly taken @mandar1045 claimed this 12 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 30/100
phoenixframework/phoenix#6895 ·
Maintainers usually reply within 1 day
-
Connection: close header not sent before closing HTTP 1.1 connection when a controller raises an exceptionPossibly taken @javiergarea claimed this 41 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 55/100
phoenixframework/phoenix#6859 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
phoenixframework/phoenix#6853 · 4 comments ·
Maintainers usually reply within 1 day
All issues in phoenixframework/phoenix
Similar issues
-
Bug: Table layout and date column are cut off on mobile screens on the Tournaments -> History pageOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
hexlet-codebattle/codebattle#2375 ·
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wintermeyer/vutuv#2388 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Broadcast API docs say to prepend realtime: to the topic, which breaks deliveryPossibly taken @mandar1045 claimed this 1 day ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
phoenixframework/phoenix_live_view#4509 ·
Maintainers usually reply within 1 day