nix3-bundle(1)
π nix3-bundle(1) β General Commands Manual, bestie edition
okay so real talk: this page lives in the Nix 3 section of the General Commands Manual, and it's all about nix bundle. Buckle up, she's cute but she's experimental π§ͺ
β οΈ Warning: this program is experimental and its interface is subject to change. No cap. She might switch up on you.
β¨ Name β¨
nix bundle β bundle an application so that it works outside of the Nix store π
πΈ Synopsis πΈ
nix bundle [optionβ¦] installable
π¦ Examples π¦
- Bundle Hello π
# nix bundle nixpkgs#hello
# ./hello
Hello, world!
- Bundle a specific version of Nix π
# nix bundle github:NixOS/nix/e3ddffb27e5fc37a209cfd843c6f7f6a9460a8ec
# ./nix --version
nix (Nix) 2.4pre20201215_e3ddffb
- Bundle a Hello using a specific bundler π
# nix bundle --bundler github:NixOS/bundlers#toDockerImage nixpkgs#hello
# docker load < hello-2.10.tar.gz
# docker run hello-2.10:latest hello
Hello, world!
π Description π
nix bundle, by default, packs the closure of the installable into a single self-extracting executable. See the bundlers homepage for more details. it's giving "one file, all the vibes" β¨
π Note: This command only works on Linux. sorry to the mac girlies π
π Flake output attributes π
If no flake output attribute is given, nix bundle tries the following flake output attributes:
bundlers.<system>.default
If an attribute name is given, nix bundle tries the following flake output attributes:
bundlers.<system>.<name>
π Bundlers π
A bundler is specified by a flake output attribute named bundlers.<system>.<name>. It looks like this:
bundlers.x86_64-linux = rec {
identity = drv: drv;
blender_2_79 = drv: self.packages.x86_64-linux.blender_2_79;
default = identity;
};
A bundler must be a function that accepts an arbitrary value (typically a derivation or app definition) and returns a derivation. that's the whole vibe check β
β¨ OPTIONS β¨
--bundler,-Bflake-url β use a custom bundler instead of the default (github:NixOS/bundlers).--out-link,-opath β override the name of the symlink to the build result. it defaults to the base name of the app. π
π§ Common evaluation options π§
--argname expr β pass the value expr as the argument name to Nix functions.--arg-from-filename path β pass the contents of file path as the argument name to Nix functions.--arg-from-stdinname β pass the contents of stdin as the argument name to Nix functions.--argstrname string β pass the string string as the argument name to Nix functions.--debuggerβ start an interactive environment if evaluation fails. slay, debug mode π--eval-storestore-url β the URL of the Nix store to use for evaluation, i.e. to store derivations (.drvfiles) and inputs referenced by them.--impureβ allow access to mutable paths and repositories. living dangerously, love that for you π--include,-Ipath β add path to search path entries used to resolve lookup paths.
This option may be given multiple times.
Paths added through -I take precedence over the nix-path configuration setting and the NIX_PATH environment variable.
--override-flakeoriginal-ref resolved-ref β override the flake registries, redirecting original-ref to resolved-ref.
πΈ Common flake-related options πΈ
--commit-lock-fileβ commit changes to the flake's lock file.--inputs-fromflake-url β use the inputs of the specified flake as registry entries.--no-registriesβ don't allow lookups in the flake registries.
π DEPRECATED β use --no-use-registries instead.
--no-update-lock-fileβ do not allow any updates to the flake's lock file.--no-write-lock-fileβ do not write the flake's newly generated lock file.--output-lock-fileflake-lock-path β write the given lock file instead offlake.lockwithin the top-level flake.--override-inputinput-path flake-url β override a specific flake input (e.g.dwarffs/nixpkgs). The input path must not be empty. This implies--no-write-lock-file.--recreate-lock-fileβ recreate the flake's lock file from scratch.
π DEPRECATED β use nix flake update instead.
--reference-lock-fileflake-lock-path β read the given lock file instead offlake.lockwithin the top-level flake.--update-inputinput-path β update a specific flake input (ignoring its previous entry in the lock file).
π DEPRECATED β use nix flake update instead.
π«Ά Logging-related options π«Ά
--debugβ set the logging verbosity level to 'debug'.--log-formatformat β set the format of log output; one ofraw,internal-json,barorbar-with-logs.--print-build-logs,-Lβ print full build logs on standard error.--quietβ decrease the logging verbosity level. shhh π€«--verbose,-vβ increase the logging verbosity level.
β Miscellaneous global options β
--helpβ show usage information.--offlineβ disable substituters and consider all previously downloaded files up-to-date.--optionname value β set the Nix configuration setting name to value (overridingnix.conf).--refreshβ consider all previously downloaded files out-of-date.--repairβ during evaluation, rewrite missing or corrupted files in the Nix store. During building, rebuild missing or corrupted store paths.--versionβ show version information.
π Options that change the interpretation of installables π
--exprexpr β interpret installables as attribute paths relative to the Nix expression expr.--file,-ffile β interpret installables as attribute paths relative to the Nix expression stored in file. If file is the character-, then a Nix expression is read from standard input. Implies--impure.
π Note: see man nix.conf for overriding configuration settings with command line flags.
and that's the whole page, bestie β no crumbs left behind πβ¨
signing off from nix3-bundle(1) in the General Commands Manual π¦ periodt. π
π¦ where this page comes from
- fedora 44: nix-core 2.35.3-2.fc44 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms