Skip to content

Commit

Permalink
Merge pull request #10710 from fricklerhandwerk/nix-store-import-example
Browse files Browse the repository at this point in the history
add example to `nix-store --import`
  • Loading branch information
tomberek committed May 19, 2024
2 parents beb3c2b + dcc2a51 commit 6193737
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions doc/manual/src/command-ref/nix-store/import.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,21 @@ If a path [refers](@docroot@/glossary.md#gloss-reference) to another path that d
{{#include ../opt-common.md}}

{{#include ../env-common.md}}

# Examples

> **Example**
>
> Given a closure of GNU Hello as a file:
>
> ```shell-session
> $ storePath="$(nix-build '<nixpkgs>' -I nixpkgs=channel:nixpkgs-unstable -A hello --no-out-link)"
> $ nix-store --export $(nix-store --query --requisites $storePath) > hello.closure
> ```
>
> Import the closure into a [remote SSH store](@docroot@/store/types/ssh-store.md) using the [`--store`](@docroot@/command-ref/conf-file.md#conf-store) option:
>
> ```console
> $ nix-store --import --store ssh:https://[email protected] < hello.closure
> ```

0 comments on commit 6193737

Please sign in to comment.