flake-parts.bundlers
Adds the bundlers flake output attribute.
Use nix bundle to create self-contained executables from derivations.
Example:
perSystem = { pkgs, ... }: {
bundlers.default = drv:
pkgs.runCommand "bundle-${drv.name}" { } ''
mkdir -p $out
cp -r ${drv}/* $out/
'';
};
Then run nix bundle --bundler .# nixpkgs#hello to bundle hello using your default bundler.
Installation
To use these options, add inside the mkFlake:
imports = [
inputs.flake-parts.flakeModules.bundlers
];
Run nix flake lock and you're set.
Options
flake
Raw flake output attributes. Any attribute can be set here, but some attributes are represented by options, to provide appropriate configuration merging.
Type: open submodule of lazy attribute set of raw value
Declared by:
flake.bundlers
See perSystem.bundlers for description and examples.
Type: lazy attribute set of lazy attribute set of function that evaluates to a(n) package
Default:
{ }
Declared by:
perSystem
A function from system to flake-like attributes omitting the <system> attribute.
Modules defined here have access to the suboptions and some convenient module arguments.
Type: module
Declared by:
perSystem.bundlers
An attribute set of bundlers to be used by nix bundle.
Bundlers are functions that accept a derivation and return a derivation. They package application closures into formats usable outside the Nix store.
nix bundle --bundler .#<name> .#<package> bundles <package> using bundler <name>.
Define a default bundler to use nix bundle --bundler .#.
Type: lazy attribute set of function that evaluates to a(n) package
Default:
{ }
Declared by: