In general, follow the guides in the nixpkgs manual.
# config/config.exs
# Configure tailwind (the version is required)
config :tailwind,
version: "3.4.12",
# Use MIX_TAILWIND_PATH to find the tailwind binary
path: System.get_env("MIX_TAILWIND_PATH"),
default: [
args: ~w(
--config=tailwind.config.js
--input=css/app.css
--output=../priv/static/assets/app.css
),
cd: Path.expand("../assets", __DIR__)
]
# flake.nix
# in the postBuild of your mixRelease
MIX_ESBUILD_NODE_PATH="${mixFodDeps}/" \
MIX_TAILWIND_PATH="${tailwindCss}/bin/tailwind" \
MIX_ESBUILD_PATH="${pkgs.esbuild}/bin/esbuild" \
mix assets.deploy