Documentation Index
Fetch the complete documentation index at: https://flox-daniel-dev-88-add-deactivate-docs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
NAME
flox-build-import-nixpkgs - Import package definition from nixpkgsSYNOPSIS
DESCRIPTION
Import a package definition from nixpkgs for use in the environment. This command copies the source code of a package from nixpkgs into the environment’s.flox/pkgs/ directory, allowing you to modify and build
the package locally.
The package definition is imported as a Nix expression file at
.flox/pkgs/<package>/default.nix, where <package> is the attribute
path of the package (e.g., hello for nixpkgs#hello).
This is useful when you need to: - Modify a package’s build process -
Apply patches or customizations - Debug package issues - Create variants
of existing packages
Installable format
The<installable> parameter can be specified in one of the following
formats:
- Attribute path only:
hello(defaults tonixpkgs#hello) - Flake reference with attribute:
nixpkgs#hello - Full flake reference:
github:nixos/nixpkgs#hello
OPTIONS
<installable>The package to import from nixpkgs. Can be specified as an attribute path (e.g.,
hello) or as a flake reference with attribute path (e.g.,
nixpkgs#hello).
--forceOverwrite existing package file if it already exists. Without this flag, the command will fail if the package file already exists in the environment.
Environment Options
If no environment is specified for an environment command, the environment in the current directory or the active environment that was last activated is used.-d, --dirPath containing a .flox/ directory.
General Options
-h, --helpPrints help information. The following options can be passed when running any
flox subcommand
but must be specified before the subcommand.
-v, --verboseIncrease logging verbosity. Invoke multiple times for increasing detail.
-q, --quietSilence logs except for errors.
EXAMPLES
Import a simple package
Import thehello package from nixpkgs:
.flox/pkgs/hello/default.nix with the package definition.
Import from a specific nixpkgs revision
Import a package from a specific nixpkgs revision:Overwrite an existing package
Force import a package, overwriting any existing definition:Import a complex package
Import a package with a nested attribute path:.flox/pkgs/python310Packages/requests/default.nix.
NOTES
- This command only works with local environments (not managed or remote environments)
- The imported package definition is a snapshot of the source code at the time of import
- You can modify the imported package definition and build it using
flox build - The package will be available in the environment’s build context
SEE ALSO
flox-build(1)
flox-build-clean(1)
manifest.toml(5)