$ which elixir↵ elixir not found $ which mix↵ mix not found $ nix-shell -p elixir --run 'mix devenv.new igniter.new demo_app '\↵ '--devenv postgres,bun '\↵ '--install ash,ash_postgres,ash_graphql '\↵ '--auth-strategy magic_link '\↵ '--with phx.new'↵ fetching path input 'path:/nix/store/kxxnzyhr1sbm5jjm3pvysi08wzsw0k2g-source' Creating project with igniter.new... * creating demo_app/lib/demo_app/application.ex * creating demo_app/lib/demo_app.ex * creating demo_app/lib/demo_app_web/controllers/error_json.ex * creating demo_app/lib/demo_app_web/endpoint.ex * creating demo_app/lib/demo_app_web/router.ex * creating demo_app/lib/demo_app_web/telemetry.ex * creating demo_app/lib/demo_app_web.ex * creating demo_app/mix.exs * creating demo_app/README.md * creating demo_app/.formatter.exs * creating demo_app/.gitignore * creating demo_app/test/support/conn_case.ex * creating demo_app/test/test_helper.exs * creating demo_app/test/demo_app_web/controllers/error_json_test.exs * creating demo_app/lib/demo_app/repo.ex * creating demo_app/priv/repo/migrations/.formatter.exs * creating demo_app/priv/repo/seeds.exs * creating demo_app/test/support/data_case.ex * creating demo_app/lib/demo_app_web/controllers/error_html.ex * creating demo_app/test/demo_app_web/controllers/error_html_test.exs * creating demo_app/lib/demo_app_web/components/core_components.ex * creating demo_app/lib/demo_app_web/controllers/page_controller.ex * creating demo_app/lib/demo_app_web/controllers/page_html.ex * creating demo_app/lib/demo_app_web/controllers/page_html/home.html.heex * creating demo_app/test/demo_app_web/controllers/page_controller_test.exs * creating demo_app/lib/demo_app_web/components/layouts/root.html.heex * creating demo_app/lib/demo_app_web/components/layouts.ex * creating demo_app/priv/static/images/logo.svg * creating demo_app/lib/demo_app/mailer.ex * creating demo_app/lib/demo_app_web/gettext.ex * creating demo_app/priv/gettext/en/LC_MESSAGES/errors.po * creating demo_app/priv/gettext/errors.pot * creating demo_app/priv/static/robots.txt * creating demo_app/priv/static/favicon.ico * creating demo_app/assets/js/app.js * creating demo_app/assets/vendor/topbar.js * creating demo_app/assets/css/app.css * creating demo_app/assets/vendor/heroicons.js * creating demo_app/assets/vendor/daisyui.js * creating demo_app/assets/vendor/daisyui-theme.js * running mix deps.get * running mix assets.setup * running mix deps.compile We are almost there! The following steps are missing: $ cd demo_app Then configure your database in config/dev.exs and run: $ mix ecto.create Start your Phoenix app with: $ mix phx.server You can also run your app inside IEx (Interactive Elixir) as: $ iex -S mix phx.server Fetching and compiling dependencies ✔ Updating project's igniter dependency ✔ installing igniter ✔ temporarily adding igniter ✔ compiling igniter ✔ setting up igniter ✔ compiling ash, ash_postgres ✔ `ash.install` ✔ installing new dependencies ✔ `ash_postgres.install` ✔ The following installers were found and executed: `ash.install`, `ash_postgres.install`: Update: .formatter.exs 1 1 |[ 2 - | import_deps: [:ecto, :ecto_sql, :phoenix], 2 + | import_deps: [:ash_postgres, :ash, :reactor, :ecto, :ecto_sql, :phoenix], 3 3 | subdirectories: ["priv/*/migrations"], 4 - | plugins: [Phoenix.LiveView.HTMLFormatter], 4 + | plugins: [Spark.Formatter, Phoenix.LiveView.HTMLFormatter], 5 5 | inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"] 6 6 |] ...| Update: config/config.exs ...| 8 8 |import Config 9 9 | 10 + |config :ash, 11 + | allow_forbidden_field_for_relationships_by_default?: true, 12 + | include_embedded_source_by_default?: false, 13 + | show_keysets_for_all_actions?: false, 14 + | default_page_type: :keyset, 15 + | policies: [no_filter_static_forbidden_reads?: false], 16 + | keep_read_action_loads_when_loading?: false, 17 + | default_actions_require_atomic?: true, 18 + | read_action_after_action_hooks_in_order?: true, 19 + | bulk_actions_default_to_errors?: true 20 + | 21 + |config :spark, 22 + | formatter: [ 23 + | remove_parens?: true, 24 + | "Ash.Resource": [ 25 + | section_order: [ 26 + | :postgres, 27 + | :resource, 28 + | :code_interface, 29 + | :actions, 30 + | :policies, 31 + | :pub_sub, 32 + | :preparations, 33 + | :changes, 34 + | :validations, 35 + | :multitenancy, 36 + | :attributes, 37 + | :relationships, 38 + | :calculations, 39 + | :aggregates, 40 + | :identities 41 + | ] 42 + | ], 43 + | "Ash.Domain": [section_order: [:resources, :policies, :authorization, :domain, :execution]] 44 + | ] 45 + | 10 46 |config :demo_app, 11 47 | ecto_repos: [DemoApp.Repo], ...| Update: config/dev.exs 1 1 |import Config 2 + |config :ash, policies: [show_policy_breakdowns?: true] 2 3 | 3 4 |# Configure your database ...| Update: config/test.exs 1 1 |import Config 2 + |config :ash, policies: [show_policy_breakdowns?: true] 2 3 | 3 4 |# Configure your database ...| Update: lib/demo_app/repo.ex 1 1 |defmodule DemoApp.Repo do 2 - | use Ecto.Repo, 3 - | otp_app: :demo_app, 4 - | adapter: Ecto.Adapters.Postgres 2 + | use AshPostgres.Repo, 3 + | otp_app: :demo_app 4 + | 5 + | @impl true 6 + | def installed_extensions do 7 + | # Add extensions here, and the migration generator will install them. 8 + | ["ash-functions"] 9 + | end 10 + | 11 + | # Don't open unnecessary transactions 12 + | # will default to `false` in 4.0 13 + | @impl true 14 + | def prefer_transaction? do 15 + | false 16 + | end 17 + | 18 + | @impl true 19 + | def min_pg_version do 20 + | %Version{major: 16, minor: 0, patch: 0} 21 + | end 5 22 |end 6 23 | Update: mix.exs ...| 11 11 | aliases: aliases(), 12 12 | deps: deps(), 13 - | listeners: [Phoenix.CodeReloader] 13 + | listeners: [Phoenix.CodeReloader], 14 + | consolidate_protocols: Mix.env() != :dev 14 15 | ] 15 16 | end ...| 75 76 | defp aliases do 76 77 | [ 77 - | setup: ["deps.get", "ecto.setup", "assets.setup", "assets.build"], 78 + | setup: ["deps.get", "ash.setup", "assets.setup", "assets.build", "run priv/repo/seeds.exs"], 78 79 | "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"], 79 80 | "ecto.reset": ["ecto.drop", "ecto.setup"], 80 - | test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"], 81 + | test: ["ash.setup --quiet", "test"], 81 82 | "assets.setup": ["tailwind.install --if-missing", "esbuild.install --if-missing"], 82 83 | "assets.build": ["tailwind demo_app", "esbuild demo_app"], ...| These tasks will be run after the above changes: * ash.codegen initialize Proceed with changes? [Y/n] Resolving Hex dependencies... Resolution completed in 0.189s Unchanged: ash 3.5.26 ash_postgres 2.6.10 ash_sql 0.2.85 bandit 1.7.0 db_connection 2.8.0 decimal 2.3.0 dns_cluster 0.1.3 ecto 3.13.2 ecto_sql 3.13.2 esbuild 0.10.0 ets 0.9.0 expo 1.1.0 file_system 1.1.0 finch 0.20.0 floki 0.38.0 gettext 0.26.2 glob_ex 0.1.11 hpax 1.0.3 igniter 0.6.14 iterex 0.1.2 jason 1.4.4 libgraph 0.16.0 mime 2.0.7 mint 1.7.1 nimble_options 1.1.1 nimble_pool 1.1.0 owl 0.12.2 phoenix 1.8.0-rc.3 phoenix_ecto 4.6.5 phoenix_html 4.2.1 phoenix_live_dashboard 0.8.7 phoenix_live_reload 1.6.0 phoenix_live_view 1.0.17 phoenix_pubsub 2.1.3 phoenix_template 1.0.4 plug 1.18.1 plug_crypto 2.1.1 postgrex 0.20.0 reactor 0.15.6 req 0.5.14 rewrite 1.1.2 sourceror 1.10.0 spark 2.2.67 spitfire 0.2.1 splode 0.2.9 stream_data 1.2.0 swoosh 1.19.3 tailwind 0.3.1 telemetry 1.3.0 telemetry_metrics 1.1.0 telemetry_poller 1.3.0 text_diff 0.1.0 thousand_island 1.3.14 websock 0.5.3 websock_adapter 0.5.8 yamerl 0.10.0 yaml_elixir 2.11.0 ymlr 5.1.3 All dependencies are up to date ==> ash Compiling 529 files (.ex) Generated ash app ==> demo_app Compiling 15 files (.ex) Generated demo_app app Getting extensions in current project... Running codegen for AshPostgres.DataLayer... * creating priv/resource_snapshots/repo/extensions.json * creating priv/repo/migrations/20250710115210_initialize_extensions_1.exs Notices: * A `min_pg_version/0` function has been defined in `DemoApp.Repo` automatically. You may wish to update this configuration. It should be set to the lowest version that your application expects to be run against. Notices were printed above. Please read them all before continuing! Successfully installed: * ash * ash_postgres Initialising devenv... devenv initialized successfully Configuring devenv.nix with Elixir and requested features... Project demo_app created successfully! To get started: cd demo_app devenv shell # unless you have direnv installed Enabled features: bun, elixir, postgres $ cd demo_app↵ direnv: loading /private/tmp/demo_app/.envrc direnv: using devenv • Building shell ... warning: creating lock file '/private/tmp/demo_app/devenv.lock' • Using Cachix: devenv ✔ Building shell in 6.64s Running tasks devenv:enterShell Succeeded devenv:enterShell 11ms 1 Succeeded 11.27ms ✨ devenv 1.6.1 is out of date. Please update to 1.7: https://devenv.sh/getting-started/#installation direnv: export +AR +AS +CC +CONFIG_SHELL +CXX +DEVELOPER_DIR +DEVENV_DIRENVRC_ROLLING_UPGRADE +DEVENV_DIRENVRC_VERSION +DEVENV_DOTFILE +DEVENV_PROFILE +DEVENV_ROOT +DEVENV_RUNTIME +DEVENV_STATE +DEVENV_TASKS +IN_NIX_SHELL +LD +LD_DYLD_PATH +MACOSX_DEPLOYMENT_TARGET +NIX_APPLE_SDK_VERSION +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_arm64_apple_darwin +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_arm64_apple_darwin +NIX_CFLAGS_COMPILE +NIX_DONT_SET_RPATH +NIX_DONT_SET_RPATH_FOR_BUILD +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_IGNORE_LD_THROUGH_GCC +NIX_LDFLAGS +NIX_NO_SELF_RPATH +NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_arm64_apple_darwin +NIX_STORE +NM +NODE_PATH +OBJCOPY +OBJDUMP +PATH_LOCALE +PC_CONFIG_FILES +PC_SOCKET_PATH +PGDATA +PGHOST +PGPORT +PKG_CONFIG +PKG_CONFIG_PATH +RANLIB +SDKROOT +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +ZERO_AR_DATE +__darwinAllowLocalNetworking +__impureHostDeps +__propagatedImpureHostDeps +__propagatedSandboxProfile +__sandboxProfile +cmakeFlags +configureFlags +hardeningDisable +mesonFlags +name +system ~PATH ~XDG_DATA_DIRS $ devenv up↵ • Building processes ... • Using Cachix: devenv ✔ Building processes in 2.09s • Starting processes ... • Building shell ... ✔ Building shell in 42.5ms Running tasks devenv:enterShell Succeeded devenv:enterShell 8ms 1 Succeeded 8.84ms [ Process Compose monitor TUI spins up with PostgreSQL ] [ In new shell: ] $ mix test↵ ==> sourceror Compiling 12 files (.ex) Generated sourceror app ==> text_diff Compiling 1 file (.ex) Generated text_diff app ==> stream_data Compiling 3 files (.ex) Generated stream_data app ==> floki Compiling 1 file (.xrl) Compiling 2 files (.erl) Compiling 30 files (.ex) Generated floki app ==> decimal Compiling 4 files (.ex) Generated decimal app ==> spitfire Compiling 2 files (.erl) Compiling 4 files (.ex) Generated spitfire app ==> ymlr Compiling 3 files (.ex) Generated ymlr app ==> mime Compiling 1 file (.ex) Generated mime app ==> nimble_options Compiling 3 files (.ex) Generated nimble_options app ==> libgraph Compiling 15 files (.ex) Generated libgraph app ==> nimble_parsec Compiling 4 files (.ex) Generated nimble_parsec app ==> demo_app ===> Analyzing applications... ===> Compiling telemetry ==> telemetry_metrics Compiling 7 files (.ex) Generated telemetry_metrics app ==> demo_app ===> Analyzing applications... ===> Compiling telemetry_poller ==> thousand_island Compiling 16 files (.ex) Generated thousand_island app ==> jason Compiling 10 files (.ex) Generated jason app ==> esbuild Compiling 4 files (.ex) Generated esbuild app ==> phoenix_html Compiling 6 files (.ex) Generated phoenix_html app ==> phoenix_template Compiling 4 files (.ex) Generated phoenix_template app ==> db_connection Compiling 17 files (.ex) Generated db_connection app ==> expo Compiling 2 files (.erl) Compiling 22 files (.ex) Generated expo app ==> phoenix_pubsub Compiling 11 files (.ex) Generated phoenix_pubsub app ==> plug_crypto Compiling 5 files (.ex) Generated plug_crypto app ==> hpax Compiling 4 files (.ex) Generated hpax app ==> mint Compiling 1 file (.erl) Compiling 20 files (.ex) Generated mint app ==> demo_app ===> Analyzing applications... ===> Compiling yamerl ==> yaml_elixir Compiling 6 files (.ex) Generated yaml_elixir app ==> dns_cluster Compiling 1 file (.ex) Generated dns_cluster app ==> gettext Compiling 18 files (.ex) Generated gettext app ==> absinthe Compiling 1 file (.erl) Compiling 260 files (.ex) Generated absinthe app ==> splode Compiling 5 files (.ex) Generated splode app ==> glob_ex Compiling 4 files (.ex) Generated glob_ex app ==> ecto Compiling 56 files (.ex) Generated ecto app ==> ets Compiling 7 files (.ex) Generated ets app ==> plug Compiling 1 file (.erl) Compiling 40 files (.ex) Generated plug app ==> absinthe_plug Compiling 18 files (.ex) Generated absinthe_plug app ==> postgrex Compiling 68 files (.ex) Generated postgrex app ==> iterex Compiling 48 files (.ex) Generated iterex app ==> ecto_sql Compiling 25 files (.ex) Generated ecto_sql app ==> nimble_pool Compiling 2 files (.ex) Generated nimble_pool app ==> finch Compiling 14 files (.ex) Generated finch app ==> req Compiling 19 files (.ex) Generated req app ==> rewrite Compiling 13 files (.ex) Generated rewrite app ==> owl Compiling 19 files (.ex) Generated owl app ==> igniter Compiling 59 files (.ex) Generated igniter app ==> spark Compiling 38 files (.ex) Generated spark app ==> reactor Compiling 111 files (.ex) Generated reactor app ==> ash Compiling 529 files (.ex) Generated ash app ==> ash_sql Compiling 13 files (.ex) Generated ash_sql app ==> ash_postgres Compiling 56 files (.ex) warning: Igniter.Project.Config.modify_configuration_code/4 is deprecated. Use `modify_config_code/5` │ 203 │ |> Igniter.Project.Config.modify_configuration_code( │ ~ │ └─ lib/mix/tasks/ash_postgres.install.ex:203:51: Mix.Tasks.AshPostgres.Install.configure_runtime/3 └─ lib/mix/tasks/ash_postgres.install.ex:208:51: Mix.Tasks.AshPostgres.Install.configure_runtime/3 Generated ash_postgres app ==> tailwind Compiling 3 files (.ex) Generated tailwind app ==> websock Compiling 1 file (.ex) Generated websock app ==> bandit Compiling 54 files (.ex) Generated bandit app ==> swoosh Compiling 53 files (.ex) Generated swoosh app ==> websock_adapter Compiling 4 files (.ex) Generated websock_adapter app ==> phoenix Compiling 73 files (.ex) Generated phoenix app ==> absinthe_phoenix Compiling 9 files (.ex) warning: this clause of defp format_result/1 is never used │ 28 │ defp format_result(:execution_failed) do │ ~ │ └─ lib/absinthe/phoenix/controller/result.ex:28:8: Absinthe.Phoenix.Controller.Result.format_result/1 warning: this clause of defp format_result/1 is never used │ 46 │ defp format_result({:parse_failed, error}) do │ ~ │ └─ lib/absinthe/phoenix/controller/result.ex:46:8: Absinthe.Phoenix.Controller.Result.format_result/1 Generated absinthe_phoenix app ==> ash_graphql Compiling 47 files (.ex) Generated ash_graphql app ==> phoenix_live_view Compiling 39 files (.ex) Generated phoenix_live_view app ==> phoenix_live_dashboard Compiling 36 files (.ex) Generated phoenix_live_dashboard app ==> phoenix_ecto Compiling 7 files (.ex) Generated phoenix_ecto app ==> demo_app Compiling 19 files (.ex) Generated demo_app app Getting extensions in current project... Running setup for AshPostgres.DataLayer... Running ExUnit with seed: 375725, max_cases: 24 ..... Finished in 0.01 seconds (0.01s async, 0.00s sync) 5 tests, 0 failures $