stack preflight
Run shell-entry preparation tasks and explicit env imports
stack preflight
Run shell-entry preparation tasks and explicit environment imports.
stack preflight run is the safe entrypoint for tasks that should happen on
shell entry: host-side code generation and file ops. It is stack setup
restricted to reconciliation, over the same engine - it never offers addons and
never prompts, so shell entry never adopts anything. Use
stack doctor to see what it would do.
stack preflight import-env explicitly generates .stack/config.local.nix
from environment variables for pure mode.
Use import-env when you want to materialize relevant environment variables into
Nix configuration. This is intentionally explicit because it changes local config
and makes the current shell stale.
In pure mode, all environment variables are cleaned except those in devshell.clean.keep
After running stack preflight import-env, you can use nix develop
(without --impure) and direnv allow in pure mode.
Usage
stack preflight run
stack preflight import-envSubcommands
| Command | Description |
|---|---|
stack preflight run [module...] | Run safe shell-entry tasks, including host-side codegen |
stack preflight import-env | Generate .stack/config.local.nix from environment variables |
Flags
The root preflight command has no direct flags; use a subcommand.
Global Flags
These flags are inherited from parent commands.
| Flag | Type | Default | Description |
|---|---|---|---|
--daemon, -d | bool | false | Run in daemon mode (no TUI, for background processes) |
--no-color | bool | false | Disable color output |
--no-tui | bool | false | Disable interactive TUI mode |
--verbose, -v | bool | false | Enable verbose output |