Cannot run Tailwind CSS with Elixir Phoenix 1.8 project

@JonasThowsen Great, based on your comment and understanding a bit more about Tailwind, this is what I came to, which seems like an even smaller change:

diff --git flake.nix flake.nix
index 5b43ff8..dac6109 100644
--- flake.nix
+++ flake.nix
@@ -52,29 +52,30 @@
           default = pkgs.mkShell {
             buildInputs = basePackages ++ [
               pkgs.poedit
               pkgs.tailwindcss_4
               vscodeWithExtension
             ]
             ++ optional pkgs.stdenv.isLinux pkgs.libnotify # For ExUnit Notifier on Linux.
             ++ optional pkgs.stdenv.isLinux pkgs.inotify-tools; # For file_system on Linux
 
             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"
+              export TAILWINDCSS_PATH="${pkgs.lib.getExe pkgs.tailwindcss_4}"
             '';
           };
 
         };
       }
     );
 
   nixConfig.bash-prompt-suffix = ''\[\e[1;35m\]nix# \[\e[0m\]'';
 }
diff --git config/config.exs config/config.exs
index 54c28b5..77301a3 100644
--- config/config.exs
+++ config/config.exs
@@ -44,21 +44,22 @@ config :esbuild,
 
 # Configure tailwind (the version is required)
 config :tailwind,
   version: "4.1.11",
   hello: [
     args: ~w(
       --input=assets/css/app.css
       --output=priv/static/assets/css/app.css
     ),
     cd: Path.expand("..", __DIR__)
-  ]
+  ],
+  path: System.get_env("TAILWINDCSS_PATH")
3 Likes