mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 05:56:15 +02:00
expand example on nix-copy-closure
(#10708)
* expand example on nix-copy-closure Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
This commit is contained in:
parent
fc14378ae3
commit
40b7fb4f11
1 changed files with 24 additions and 13 deletions
|
@ -75,17 +75,28 @@ authentication, you can avoid typing the passphrase with `ssh-agent`.
|
||||||
|
|
||||||
# Examples
|
# Examples
|
||||||
|
|
||||||
Copy Firefox with all its dependencies to a remote machine:
|
> **Example**
|
||||||
|
>
|
||||||
|
> Copy GNU Hello with all its dependencies to a remote machine:
|
||||||
|
>
|
||||||
|
> ```shell-session
|
||||||
|
> $ storePath="$(nix-build '<nixpkgs>' -I nixpkgs=channel:nixpkgs-unstable -A hello --no-out-link)"
|
||||||
|
> $ nix-copy-closure --to alice@itchy.example.org "$storePath"
|
||||||
|
> copying 5 paths...
|
||||||
|
> copying path '/nix/store/nrwkk6ak3rgkrxbqhsscb01jpzmslf2r-xgcc-13.2.0-libgcc' to 'ssh://alice@itchy.example.org'...
|
||||||
|
> copying path '/nix/store/gm61h1y42pqyl6178g90x8zm22n6pyy5-libunistring-1.1' to 'ssh://alice@itchy.example.org'...
|
||||||
|
> copying path '/nix/store/ddfzjdykw67s20c35i7a6624by3iz5jv-libidn2-2.3.7' to 'ssh://alice@itchy.example.org'...
|
||||||
|
> copying path '/nix/store/apab5i73dqa09wx0q27b6fbhd1r18ihl-glibc-2.39-31' to 'ssh://alice@itchy.example.org'...
|
||||||
|
> copying path '/nix/store/g1n2vryg06amvcc1avb2mcq36faly0mh-hello-2.12.1' to 'ssh://alice@itchy.example.org'...
|
||||||
|
> ```
|
||||||
|
|
||||||
```console
|
> **Example**
|
||||||
$ nix-copy-closure --to alice@itchy.example.org $(type -P firefox)
|
>
|
||||||
```
|
> Copy GNU Hello from a remote machine using a known store path, and run it:
|
||||||
|
>
|
||||||
Copy Subversion from a remote machine and then install it into a user
|
> ```shell-session
|
||||||
environment:
|
> $ storePath="$(nix-instantiate --eval '<nixpkgs>' -I nixpkgs=channel:nixpkgs-unstable -A hello.outPath | tr -d '"')"
|
||||||
|
> $ nix-copy-closure --from alice@itchy.example.org "$storePath"
|
||||||
```console
|
> $ "$storePath"/bin/hello
|
||||||
$ nix-copy-closure --from alice@itchy.example.org \
|
> Hello, world!
|
||||||
/nix/store/0dj0503hjxy5mbwlafv1rsbdiyx1gkdy-subversion-1.4.4
|
> ```
|
||||||
$ nix-env --install /nix/store/0dj0503hjxy5mbwlafv1rsbdiyx1gkdy-subversion-1.4.4
|
|
||||||
```
|
|
||||||
|
|
Loading…
Reference in a new issue