diff options
author | Tom Bereknyei <tomberek@gmail.com> | 2022-01-21 11:43:11 -0500 |
---|---|---|
committer | Tom Bereknyei <tomberek@gmail.com> | 2022-01-24 21:43:04 -0500 |
commit | c94db0535c4ddd32957fd80d0713797ec73cc70b (patch) | |
tree | 7786543f851007b3e26f1bd24f22099a2905ff8b /src/nix/bundle.md | |
parent | 3be810f5dbfaac8ced55e22fe8939c094e4a57fc (diff) |
Refactor bundler API
Bundlers now expect to be located at bundlers.<system>.<name> and are a
function from derivations to derivations.
Diffstat (limited to 'src/nix/bundle.md')
-rw-r--r-- | src/nix/bundle.md | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/src/nix/bundle.md b/src/nix/bundle.md index 5e2298376..317b7000b 100644 --- a/src/nix/bundle.md +++ b/src/nix/bundle.md @@ -18,12 +18,20 @@ R""( nix (Nix) 2.4pre20201215_e3ddffb ``` +* Bundle a Hello using a specific bundler: + + ```console + # 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` packs the closure of the [Nix app](./nix3-run.md) -*installable* into a single self-extracting executable. See the -[`nix-bundle` homepage](https://github.com/matthewbauer/nix-bundle) -for more details. +`nix bundle`, by default, packs the closure of the [Nix app](./nix3-run.md) +*installable* into a single self-extracting executable. See the [`nix-bundle` +homepage](https://github.com/matthewbauer/nix-bundle) for more details. > **Note** > @@ -31,6 +39,29 @@ for more details. # Bundler definitions -TODO +If no flake output attribute is given, `nix bundle` tries the following +flake output attributes: + +* `defaultBundler.<system>` + +If an attribute *name* is given, `nix run` tries the following flake +output attributes: + +* `bundler.<system>.<name>` + +# Bundlers + +An bundlers is specified by a flake output attribute named +`bundlers.<system>.<name>` or `defaultBundler.<system>`. It looks like this: + +```nix +bundlers.x86_64-linux.identity = drv: drv; + +bundlers.x86_64-linux.blender_2_79 = drv: self.packages.x86_64-linux.blender_2_79; + +defaultBundler.x86_64-linux = drv: drv; +``` + +A bundler must be a function that accepts a derivation and returns a derivation. )"" |