https://github.com/lambdachad/studio
Elixir Phoenix LiveView running with Nix
https://github.com/lambdachad/studio
elixir liveview nix phoenix
Last synced: about 1 month ago
JSON representation
Elixir Phoenix LiveView running with Nix
- Host: GitHub
- URL: https://github.com/lambdachad/studio
- Owner: lambdachad
- Created: 2024-05-12T21:20:04.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-14T13:18:27.000Z (about 2 years ago)
- Last Synced: 2026-04-13T14:30:36.666Z (2 months ago)
- Topics: elixir, liveview, nix, phoenix
- Language: Elixir
- Homepage:
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# studio
To run it locally with Nix, do following:
```
MIX_ENV=prod PHX_SERVER=true RELEASE_TMP=/tmp RELEASE_COOKIE=my-cookie DATABASE_URL=postgres://postgres:postgres@localhost/studio_dev SECRET_KEY_BASE=DwdeOT9NnjAf5k2gNnQ8VkEEe5PIQm+ujFWhW+uq0u3EeHGSi4cVSMQbLFJo8vpa nix run .#default -- start
```
## Notes
I had to do following when running a Phoenix LiveView application in Nix:
- Run `mix2nix > deps.nix`
- Modify `config/config.exs` and add `path: System.get_env("MIX_ESBUILD_PATH")` for `:esbuild` and `path: System.get_env("MIX_TAILWIND_PATH")` for `:tailwind`. Because Mix tries to download TailwindCSS and Esbuild from GitHub, we have to specify these custom binaries via Nix and environment variables
- I had to get rid of heroicons in `tailwind.config.js`, had some issues I didn't figure out with that one
- When running, you need to define `RELEASE_TMP`, `RELEASE_COOKIE`, `DATABASE_URL`, `SECRET_KEY_BASE`, `MIX_ENV` and `PHX_SERVER`